Class Inx_Api_Reporting_ReportRequest

Description

The Inx_Api_Reporting_ReportRequest describes a report to be generated.

The Inx_Api_Reporting_ReportRequest describes a report to be generated. To generate a report, you first need to create a ReportRequest which contains the relevant information needed to generate the report:

  • The report name
  • The output format (e.g. OUTPUT_FORMAT_HTML, OUTPUT_FORMAT_PDF_A4)
  • The output locale (e.g. "de_DE", "en_US")
  • The output time zone (e.g. "Europe/Berlin", "America/New_York")
  • Probably some report specific properties (e.g. "listid", "limit")
The report request is sent to the server where the actual report generation takes place.

To specify dates, like the begin or end date of a report, use putParameter() and specify the number of milliseconds since the epoch. To do so, use the strtotime() function. The following snippet shows how to specify an end date one week ago:

 //strtotime returns the seconds since the epoch -> * 1000
 $iOneWeekAgo = strtotime("-1 week") * 1000;

 $oReportRequest = ...
 $oReportRequest->putParameter("end", $iOneWeekAgo);
To pass a specific date, use the english date format (YYYY-MM-DD HH:MM:SS). The following snippet shows how to specify the begin date 2000-01-01 00:00:
 //strtotime returns the seconds since the epoch -> * 1000
 $iMillennium = strtotime("2000-01-01 00:00") * 1000;

 $oReportRequest = ...
 $oReportRequest->putParameter("begin", $iMillennium);

Please note: some reports require you to specify the type of the mailing for which the report is built. To specify this mailing type, use the putMailingTypeParameter($sKey, $oMailingType) method which accepts Inx_Api_Reporting_ReportMailingTypes. To find out which reports expect a mailing type parameter, take a look at the reports reference in the Inxmail Professional API Developer Guide.

For an example on how to retrieve a report, see the Inx_Api_Reporting_ReportEngine documentation.

  • version: $Revision: 9553 $ $Date: 2008-01-04 11:28:41 +0200 (Pn, 04 Sau 2008) $ $Author: vladas $
  • see: Inx_Api_Reporting_ReportEngine
  • since: API 1.3

Located in /Api/Reporting/ReportRequest.php (line 58)


	
			
Class Constant Summary
Method Summary
Inx_Api_Reporting_ReportRequest __construct (string $sReportName, int $sOutputFormat, string $sOutputLocale, string $sOutputTimeZone)
string getOutputLocale ()
string getOutputTimeZone ()
string getParameter (string $sKey)
array getParameterKeys ()
string getReportName ()
void putMailingTypeParameter (string $sKey, Inx_Api_Reporting_ReportMailingType $oMailingType)
void putParameter (string $sKey, string $value)
Methods
Constructor __construct (line 134)

Creates a new report request object for the report specified by the given name.

Creates a new report request object for the report specified by the given name. The report will be generated in the given output format, using the specified locale and time zone.

  • access: public
Inx_Api_Reporting_ReportRequest __construct (string $sReportName, int $sOutputFormat, string $sOutputLocale, string $sOutputTimeZone)
  • string $sReportName: the name of the report to generate. For a full list of the supported reports, see Appendix A of the API Developer Guide.
  • int $sOutputFormat: the output format. The supported formats are:
    • OUTPUT_FORMAT_HTML_INXLINKS
    • OUTPUT_FORMAT_HTML
    • OUTPUT_FORMAT_PDF_A4
    • OUTPUT_FORMAT_PDF_US_LETTER
    • OUTPUT_FORMAT_PDF_US_LEGAL
    • OUTPUT_FORMAT_CSV
  • string $sOutputLocale: the output locale. Use the name of the locale, with the language (defined by ISO-639) or the language and country (defined by ISO-3166) separated by an underscore. For example: "de_DE", "de_CH", "de", "en", "en_GB", "it_IT", "fr_FR"
  • string $sOutputTimeZone: the output time zone. Use Inx_Api_Reporting_ReportEngine::getSupportedTimeZones() to find out which time zones are supported. For example: "Europe/Berlin", "Europe/Rome", "America/New_York"
getOutputFormat (line 168)

Returns the output format of the report.

Returns the output format of the report. May be one of:

  • OUTPUT_FORMAT_HTML_INXLINKS
  • OUTPUT_FORMAT_HTML
  • OUTPUT_FORMAT_PDF_A4
  • OUTPUT_FORMAT_PDF_US_LETTER
  • OUTPUT_FORMAT_PDF_US_LEGAL
  • OUTPUT_FORMAT_CSV

  • return: the output format.
  • access: public
int getOutputFormat ()
getOutputLocale (line 183)

Returns the output locale of the report.

Returns the output locale of the report. Use the name of the locale, with the language (defined by ISO-639) or the language and country (defined by ISO-3166) separated by an underscore. For example: "de", "de_CH", "en", "en_GB", "it", "fr"

  • return: the output locale of the report.
  • access: public
string getOutputLocale ()
getOutputTimeZone (line 198)

Returns the output time zone of the report.

Returns the output time zone of the report. Use Inx_Api_Reporting_ReportEngine::getSupportedTimeZones() to find out which time zones are supported. For example: "Europe/Berlin", "Europe/Rome", "America/New_York"

  • return: the output time zone of the report.
  • access: public
string getOutputTimeZone ()
getParameter (line 212)

Returns the value to which this Inx_Api_Reportin_ReportRequest maps the specified key.

Returns the value to which this Inx_Api_Reportin_ReportRequest maps the specified key. Returns null if this report request contains no mapping for this key.

  • return: the value to which this ReportRequest maps the specified key, or null if this report request contains no mapping for this key.
  • access: public
string getParameter (string $sKey)
  • string $sKey: the key whose value shall be returned.
getParameterKeys (line 252)

Returns an array of the keys contained in this report request.

Returns an array of the keys contained in this report request.

  • return: an array of the keys contained in this report request.
  • access: public
array getParameterKeys ()
getReportName (line 149)

Returns the name of the report to generate.

Returns the name of the report to generate.

  • return: the name of the report.
  • access: public
string getReportName ()
putMailingTypeParameter (line 241)

Associates the specified value with the specified key in this report request. specify the type of the mailing the report concerns.

Associates the specified value with the specified key in this report request. This method should be used to specify the type of the mailing the report concerns.

  • since: API 1.11.1
  • access: public
void putMailingTypeParameter (string $sKey, Inx_Api_Reporting_ReportMailingType $oMailingType)
  • string $sKey: the key with which the specified value is to be associated.
  • Inx_Api_Reporting_ReportMailingType $oMailingType: the mailing type to be associated with the specified key.
putParameter (line 227)

Associates the specified value with the specified key in this report request.

Associates the specified value with the specified key in this report request. For an example on how to specify dates, see the documentation of this class.

  • access: public
void putParameter (string $sKey, string $value)
  • string $sKey: the key with which the specified value is to be associated.
  • string $value: the value to be associated with the specified key.
Class Constants
OUTPUT_FORMAT_CSV = 20 (line 68)

Output format: Character Separated Values (CSV)

Output format: Character Separated Values (CSV)

OUTPUT_FORMAT_HTML = 11 (line 65)

Output format: HTML

Output format: HTML

OUTPUT_FORMAT_HTML_INXLINKS = 10 (line 62)

Output format: HTML with inxmail special hyperlinks

Output format: HTML with inxmail special hyperlinks

OUTPUT_FORMAT_PDF_A4 = 30 (line 71)

Output format: PDF on A4 page size

Output format: PDF on A4 page size

OUTPUT_FORMAT_PDF_US_LEGAL = 32 (line 77)

Output format: PDF on US-Legal page size

Output format: PDF on US-Legal page size

OUTPUT_FORMAT_PDF_US_LETTER = 31 (line 74)

Output format: PDF on US-Letter page size

Output format: PDF on US-Letter page size

Documentation generated on Thu, 17 Sep 2015 14:27:29 +0200 by phpDocumentor 1.3.2