generate
Returns the XML or HTML representation of an analytic report.
Description
The report's contents, filtering parameters, and display type are determined by the API parameters. This generic function provides a wide range of capabilities for report generation.
Parameters
- action
- generate
- topic
- A single topic ID. The report will only consider events that are related to this specific topic.
- scaleType
- Determines the scale type for a line chart, defaults to "daily"
- fromDate
- The starting date for a date range of events that should be considered, such as "2012-03-16"
- pubs
- A comma-delimited list of publications. The report will only consider events that occur within one of these publications.
- report
-
ID of the report to generate, which must exist in your skin's
config/analytics.xmlreport definition file. - chart
- Determines the chart type for this report, such as PieChart, LineChart, BarChart, or TableView. If not provided, the report will use its default chart type.
- toDate
- The ending date for a date range of events that should be considered, such as "2012-04-14"
- format
- The output format for the results, "html", "xml", or "xlsx" to export an Excel table. Defaults to "html"
- lang
- A comma-delimited list of language codes, such as "en" or "en-GB". The report will only consider events that occurred within one of these language contexts.
- groups
- A comma-delimited list of group names. The report will only consider events that were executed by a user who is a member of one of these groups.
Example URL
http://<host>:<port>/<context>/web/analytics.xql?action=generate&topic=<value>&scaleType=<value>&fromDate=<value>&pubs=<value>&report=<value>&chart=<value>&toDate=<value>&format=<value>&lang=<value>&groups=<value>
Successful Result
CSV, HTML or XML representaiton of the report. CSV content will be loaded in Microsoft Excel, while XML content is loaded into an AnyChart graph, and HTML content is rendered to the screen, usually as a table.
Failed Result
The user may be denied permission to generate such a report if the user lacks the "Use analytics" permission.