Execute Report Script

get

/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/executeReport

Returns output generated by executing a report script specification file.

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

OK

Report generated successfully.

500 Response

Internal Server Error.

Back to Top

Examples

The following example shows how to get the results of a report script saved as an artifact in the Essbase cube directory.

This example uses cURL to access the REST API from a Windows shell script. The calling user's ID and password are variables whose values are set in properties.bat.

For this example, assume there is a report script, orderby, that is associated with the Sample application and Basic cube. The contents of the script are:

//Sample 18: Ordering Data Values  // cube: sample.basic // script: orderby.rep<Page
          ("Measures")<Column
          ("Scenario",
          "Year")<Row
          ("Market",
          "Product")"Sales""Scenario""Jan" "Feb" "Mar" "Apr""New York" "Product" "100" "100-10" "100-20" "100-30" "200" "200-10""200-20" "200-30" "200-40" "300" "300-10" "300-20" "300-30" "400""400-10" "400-20" "400-30" "Diet" "100-20" "200-20" "300-30"<ORDERBY
          ("Product",
          @DATACOLUMN(1)
          ASC,
          @DATACOLUMN(2)
          DESC,
          @DATACOLUMN(3)
          ASC
          @DATACOLUMN
          (4) DESC)     ! 

Script with cURL Command

The following Windows script runs the report script and writes its output to a file.

call properties.bat
curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/applications/Sample/databases/Basic/executeReport?filename=orderby&lockForUpdate=false" -H "Accept:application/octet-stream" -o orderby_out.txt -u %User%:%Password%

Example of Response Body

If successful, the following report output is written to orderby_out.txt.

                                             Sales Scenario 

                                       Jan      Feb      Mar      Apr 
                                  ======== ======== ======== ======== 

New York         100-20           #Missing #Missing #Missing #Missing 
                 100-30           #Missing #Missing #Missing #Missing 
                 200-20           #Missing #Missing #Missing #Missing 
                 200-30           #Missing #Missing #Missing #Missing 
                 300-30           #Missing #Missing #Missing #Missing 
                   Diet           #Missing #Missing #Missing #Missing 
                 200-10                 61       61       63       66 
                 400-30                134      189      198      198 
                 300-20                180      180      182      189 
                 400-20                219      243      213      223 
                 400-10                234      232      234      245 
                 300-10                483      495      513      638 
                 200-40                490      580      523      564 
                   200                 551      641      586      630 
                   400                 587      664      645      666 
                   300                 663      675      695      827 
                 100-10                678      645      675      712 
                   100                 678      645      675      712 
                     Product         2,479    2,625    2,601    2,835 

If there is something wrong, an error is returned. For example,

{
  "errorMessage" : "NULL argument (5) passed to ESSAPI function EssReportFile",
  "errorCode" : 1030008
}
Back to Top