This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Reports in GoodData
Overview
The following operations allow you to work with reports. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with reports, see Sample configuration.
Operation | Description |
---|---|
Creates a report definition. | |
executeReport | Executes a selected report. |
listReports | Returns a list of available field names. |
saveReport | Saves a created report. |
Operation details
This section provides details on the operations.
Creating a report
The createReport
operation is used to create a report definition, after which it can be saved as a report using saveReport.
<gooddata.createReport> <content>{$ctx:content}</content> <projectId>{$ctx:projectId}</projectId> <meta>{$ctx:meta}</meta> </gooddata.createReport>
Properties
content:
Required - The content, which is an object containing domains and definitions.projectId:
Required - The ID of the project in which you want to save the report.meta:
An object containing the metadata of the report to be saved.
Sample request
Following is a sample REST request that can be handled by the createReport operation.
{ "apiUrl":"https://secure.gooddata.com", "username":"user@gmail.com", "password":"user@123", "remember":"1", "projectId":"qy48iv4flikdlcwpwioizuip74wt8nb5", "meta": {"title":"Untitled report definition","summary":"Sample report","tags":"sample","deprecated":0,"category":"reportDefinition"}, "content":{"filters":[],"format":"grid","grid":{"rows":[],"columns":["metricGroup"],"sort":{"columns":[],"rows":[]},"columnWidths":[],"metrics": [{"uri":"/gdc/md/qy48iv4flikdlcwpwioizuip74wt8nb5/obj/63f3cecd2a8d3ce2ec9378381c8f39e3","alias":""}]}} }
Related GoodData documentation
http://docs.gooddata.apiary.io/#post-%2Fgdc%2Fmd%2F%7Bproject-id%7D%2Fobj
Executing a report
The executeReport
operation is used to execute the selected report using the Report Definition URI.
<gooddata.executeReport> <reportUri>{$ctx:reportUri}</reportUri> </gooddata.executeReport>
Properties
reportUri:
URI of the report to be executed.
Sample request
Following is a sample REST request that can be handled by the executeReport operation.
{ "apiUrl":"https://secure.gooddata.com", "username":"user@gmail.com", "password":"user@123", "remember":"1", "reportUri":"/gdc/md/qy48iv4flikdlcwpwioizuip74wt8nb5/obj/4265" }
Related GoodData documentation
http://docs.gooddata.apiary.io/#post-%2Fgdc%2Fxtab2%2Fexecutor3
Listing reports
The listReports
operation is used to list all the reports in a given project.
<gooddata.listReports> <projectId>{$ctx:projectId}</projectId> </gooddata.listReports>
Properties
projectId:
Required - The ID of the project from which the reports should be retrieved.
Sample request
Following is a sample REST request that can be handled by the listReports operation.
{ "apiUrl":"https://secure.gooddata.com", "username":"user@gmail.com", "password":"user@123", "remember":"1", "projectId":"qy48iv4flikdlcwpwioizuip74wt8nb5" }
Related GoodData documentation
http://docs.gooddata.apiary.io/#get-%2Fgdc%2Fmd%2F%7Bproject-id%7D%2Fquery%2Freports
Saving a report
The saveReport
operation allows you to save the report definition as a report so that it is visible in the user interface.
<gooddata.saveReport> <content>{$ctx:content}</content> <projectId>{$ctx:projectId}</projectId> <meta>{$ctx:meta}</meta> </gooddata.saveReport>
Properties
content:
Optional - The content, which is an object containing domains and definitions.projectId:
Required - The ID of the project in which you want to save the report.meta:
An object containing the metadata of the report to be saved.
Sample request
Following is a sample REST request that can be handled by the saveReport operation.
{ "apiUrl":"https://secure.gooddata.com", "username":"User@gmail.com", "password":"user@123", "remember":"1", "projectId":"qy48iv4flikdlcwpwioizuip74wt8nb5", "meta": {"title": "Test Report", "summary": "", "tags": "", "deprecated": 0} }
Related GoodData documentation
http://docs.gooddata.apiary.io/#post-%2Fgdc%2Fmd%2F%7Bproject-id%7D%2Fobj
Sample configuration
Following is a sample proxy service that illustrates how to connect to GoodData with the init
operation and use the createReport operation. The sample request for this proxy can be found in createReport sample request. You can use the sample below as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="gooddata_createReport" transports="https" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="username" expression="json-eval($.username)"/> <property name="password" expression="json-eval($.password)"/> <property name="remember" expression="json-eval($.remember)"/> <property name="projectId" expression="json-eval($.projectId)"/> <property name="content" expression="json-eval($.content)"/> <property name="meta" expression="json-eval($.meta)"/> <gooddata.init> <remember>{$ctx:remember}</remember> <username>{$ctx:username}</username> <apiUrl>{$ctx:apiUrl}</apiUrl> <password>{$ctx:password}</password> </gooddata.init> <gooddata.createReport> <content>{$ctx:content}</content> <projectId>{$ctx:projectId}</projectId> <meta>{$ctx:meta}</meta> </gooddata.createReport> <respond></respond> </inSequence> <outSequence> <send></send> </outSequence> </target> </proxy>