Exago Logo
Search
Generic filters
Exact matches only

REST – GetExecute

GetExecute is used to execute reports in the API, without opening an instance of Exago. If executing as text, i.e. HTML, CSV, or JSON, then the output data is returned directly in the ExecuteData property.

If executing as binary (i.e. PDF, RTF, or Excel workbook), then ExecuteData will return different responses depending on if Exago is running in a web-farm environment or not.

Not In a Web FarmIn a Web Farm
Either as:

 

  • URL string in the following format:
    ExecuteExport.aspx?{parameters}

    To download the output data, append the URL to the end of your Exago base URL and launch the full URL string in a browser:

    http://{yoursite}/{exago}/{ExecuteExportUrl}

    The string is one-use only. To re-download the file, you must create a new Export Url.

  • A base64 encoded representation of the output file.

    To display the output data, process the information from the ExecuteData property and send it to the browser.

A base64 encoded representation of the output file.

 

To display the output data, process the information from the ExecuteData property and send it to the browser.

Note

All requests require Session Id URL parameter and basic request headers. In the following examples, headers are omitted for clarity.

Since GetExecute does not load the full Exago user interface, report interactivity is not supported for these functions. However, the following Server Events are triggered by GetExecute in order to ensure that the data returned accurately reflects the report design:

Report JSON

The path to the report is passed as part of a JSON object, with optional sorts and filters. Any sorts and filters are added only for this execution, and do not persist throughout the session.

NameTypeWritableDescription
Idstringrequired*Can be used to retrieve a report from the Storage Management database in lieu of the ReportPath property below in v2021.1+
ReportPathstringrequired*Full path from the root folder to the report
DataTypeExecuteDataTypeyesChoose how Exago shall return the data to the client, either as raw data or as a URL.
Sortsarray of SortyesAny sorts to apply to the report during execution
Filtersarray of FilteryesAny filters to apply to the report during execution

* either the Id or ReportPath must be specified but not both

Execute a Report

POST /Reports/Execute/{Type}

Type indicates which format you want to receive the output data: html, csv, pdf, pdfsnapshot, rtf, excel, json.

Using curl

curl http://{webservice}/rest/Reports/Execute/csv?sid={sid} -X POST ^
	-d "{'ReportPath':'Inventory\\Products'}"

Note

Windows file paths are delimited with double-backslashes: . With Storage Management in v2020.1+, the double slash is no longer necessary.

Output JSON

GetExecute returns the following JSON object:

NameTypeDescription
ReportPathstringFull path from the root folder to this report
ExportTypestringFormat of export data
DataTypeExecuteDataTypeHow Exago has returned the data to the client, either as binary encoded string or as a URL.
ExecuteDatastringThe output of the GetExecute() method, either as a URL or binary encoded string based on the DataType property.
IsErrorbooleanWhether there were any errors when executing the report
ErrorListarray of stringIf IsError = true, a list of errors encountered when executing this report

Examples

CSV file:

POST /rest/Reports/Execute/csv
Status: 200 OK

{
  "ReportPath":  "Inventory\\Categories",
  "ExportType":  "csv",
  "DataType":    "Data",
  "ExecuteData": ""Categories"\r\n"Beverages"\r\n"Condiments"\r\n"Confections"\r\n"Dairy Products"\r\n"Grains/Cereals"\r\n"Meat/Poultry"\r\n"Produce"\r\n"Seafood"\r\n",
  "IsError":     false,
  "ErrorList":   null
}

PDF file:

POST /rest/Reports/Execute/pdf
Status: 200 OK

{
	"ReportPath": "Products",
	"ExportType": "Pdf",
	"DataType": "Data",
	"ExecuteData": "JVBERi0xLjQKJeLjz9MKMyAwIG9iaiA8PC9MZW5ndGggNDE5NC9GaWx0ZXIvRmxhdGVEZWNvZGU+PnN0cmVhbQp4nO2dW3PbNhaA3/0r+NCZdmfWXBAEL3h00jbbrdu0SbDAxODgyNCAwMDAwMCBuIAowMDAwMDE5MjU2IDAwMDAwIG4gCjAwMDAwMTkzMDEgMDAwMDAgbiAKdHJhaWxlcgo8PC9TaXplIDE2L0luZm8gMTUgMCBSL0lEIFs8ZDEyNmY0ZDQ2ZDI4OGUwNTA1YWM2MGZlYTMwOTBmYTM+PDYwNTE5NjU1NGM1OWVlODI2YmNkNzdiNDFjZmM4YWI5Pl0vUm9vdCAxNCAwIFI+PgpzdGFydHhyZWYKMTk0NDYKJSVFT0YK",
	"IsError": false,
	"ErrorList": null
}

Sort JSON

Each run-time sort is supplied using the following JSON object:

NameTypeWriteableDescription
EntityNamestringrequiredData object to sort on
ColumnNamestringrequiredColumn to sort on
AscendingFlagbooleanyes (false)Whether to sort in ascending (versus descending) order

Filter JSON

Each run-time filter is supplied using the following JSON object:

NameTypeWriteableDescription
FilterTextstringrequiredThe value of the filter, either a Category name or a formula. For example:

 

  • Employees.EmployeeName
  • =Month(Employees.BirthDate)
DataTypeenumyes (“string”)Data Field Type
Operatorenum as integeryes (0)Filter Operator Type (only accepts integer value)
Valuesarray of stringyesValues to filter with
 
EntityNamestringdeprecated (as of v2018.1)Data object to filter on
ColumnNamestringdeprecated (as of v2018.1)Column to filter on

Note

DateTime strings passed as filter values must be able to be parsed by the .NET method DateTime.Parse using the current thread culture.

Execute with Sorts and Filters

POST /rest/Reports/Execute/{Type}

Type indicates which format you want to receive the output data: html, csv, pdf, pdfsnapshot, rtf, excel, json.

Using curl

curl http://{webservice}/rest/Reports/Execute/csv?sid={sid} -X POST ^
	-d @reportExecuteResource.txt

reportExecuteResource.txt

"{
  'ReportPath': 'Inventory\\Categories',
  'Sorts': [
    {
      'EntityName': 'Categories',
      'ColumnName': 'CategoryName',
      'AscendingFlag': false
    }
  ],
  'Filters': [
    {
      'FilterText': 'Category.CategoryName'
      'DataType': 'string',
      'Operator': 14,
      'Values': [
        'Beverages',
        'Produce',
        'Seafood'
      ],
    }
  ]
}"

Example response

Status: 200 OK

{
  "ReportPath":  "Inventory\\Categories",
  "ExportType":  "csv",
  "DataType":    "Data",
  "ExecuteData": ""Categories"\r\n"Seafood"\r\n"Produce"\r\n"Beverages"\r\n",
  "IsError":     false,
  "ErrorList":   null
}
Was this article helpful?
1.8 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 50%
1 Stars 50%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents