The Inx_Api_Reporting_ReportTicket is a handle to access the report.
The Inx_Api_Reporting_ReportTicket is a handle to access the report. Using the Inx_Api_Reporting_ReportEngine it is not possible to generate a report synchronous. The Inx_Api_Reporting_ReportRequest is sent to the server instead, where the actual generation takes place. This generation is processed asynchronous, thus the result must be polled. This polling is accomplished using the ReportTicket returned by Inx_Api_Reporting_ReportEngine::generate($oRequest, $blIgnoreCache). The following snippet briefly shows how to retrieve and use a ReportTicket:
$oReportRequest = new Inx_Api_Reporting_ReportRequest( "SystemDomainDistribution", Inx_Api_Reporting_ReportRequest::OUTPUT_FORMAT_PDF_A4, "de_DE", "Europe/Berlin" ); $oReportRequest->putParameter( "limit", 20 ); $oTicket = $oSession->getReportEngine()->generate( $oReportRequest, false ); try { $oDownloadableResult = $oTicket->fetchDownloadableResult(); while( $oDownloadableResult == null ) { echo "Waiting for the report to finish..." ; sleep( 3 ); $oDownloadableResult = $oTicket->fetchDownloadableResult(); } $oInputStream = $oDownloadableResult->getInputStream(); ... } catch( ReportException x ) { echo $x->getMessage(); } if($oTicket != null) { $oTicket->close(); }
The Inx_Api_Reporting_DownloadableResult fetched from the ReportTicket is used to download the generated report. fetchDownloadableResult() will return null as long as the report generation is not finished. To download the report, just poll for the DownloadableResult to become something different from null and use the provided Inx_Api_InputStream to download the report.
<strong>Note:</strong> An Inx_Api_Reporting_ReportTicket object <strong>must</strong> be closed once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.
For a more complete example on how to generate and retrieve reports, see the Inx_Api_Reporting_ReportEngine documentation.
Located in /Api/Reporting/ReportTicket.php (line 62)
Closes this Inx_Api_Reporting_ReportTicket and releases any resources on the server associated with this object.
Closes this Inx_Api_Reporting_ReportTicket and releases any resources on the server associated with this object. An Inx_Api_Reporting_ReportTicket object <strong>must</strong> be closed once it is not needed anymore to prevent memory leaks and other potentially harmful side effects.
Returns the Inx_Api_Reporting_DownloadableResult object, if the report is completely generated.
Returns the Inx_Api_Reporting_DownloadableResult object, if the report is completely generated. Returns null, if the generation of the report has not yet finished.
The original description used to generate this report.
The original description used to generate this report.
Documentation generated on Thu, 17 Sep 2015 14:27:29 +0200 by phpDocumentor 1.3.2