|
||||||||||||||||||||
|
Sample Success Response: The following is a sample Export of data in a Table, in JSON format:
{
"response":
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Parameter
|
Possible Values
|
Description
|
| ZOHO_SHOW_HIDDENCOLS | true / false |
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported. |
Sample Success Response:
The following is a sample Export of data in a Table, in XML format
To export in HTML format, in query parameters, the value for ZOHO_OUTPUT_FORMAT should be HTML
Additional parameters (preferably to be sent in the body of the POST request).
|
Parameter
|
Possible Values
|
Description
|
| ZOHO_SHOW_HIDDENCOLS | true / false |
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported. |
To export in PDF format, in query parameters, the value for ZOHO_OUTPUT_FORMAT should be PDF
Additional parameters (preferably to be sent in the body of the POST request).
|
Parameter
|
Possible Values
|
Description
|
| ZOHO_PAPERSIZE | Value between 0 - 5 0 - LETTER 1 - LEGAL 2 - TABLOID 3 - A3 4 - A4 5 - AUTO |
The size of the paper. |
| ZOHO_SHOW_TITLE | Value between 0 - 2 0 - AT TOP 1 - AT BOTTOM 2 - NONE |
Controls the title positioning. |
| ZOHO_SHOW_DESC | Value between 0 - 2 0 - AT TOP 1 - AT BOTTOM 2 - NONE |
Controls the description positioning. |
| ZOHO_PAPERSTYLE | Portrait / Landscape | |
| ZOHO_SHOW_HIDDENCOLS | true / false |
Controls where the columns that have been hidden in the table/report have to be exported. true - To include the hidden columns of the table/report in the data exported false - To not include the hidden columns of the table/report in the data exported. |
| ZOHO_SELECTED_COLUMNS | List of comma separated column names | Controls the column names that need to be exported. If it is not given then all the columns, in the table/report, are exported. |
| Margin Settings: | ||
| ZOHO_TOPMARGIN | Decimal values between 0 to 1 | The margin in inches for that edge. Can be decimal between 0 to 1 (like 0.5). |
| ZOHO_BOTTOMMARGIN | ||
| ZOHO_LEFTMARGIN | ||
| ZOHO_RIGHTMARGIN | ||
| Header/Footer Settings: | ||
| ZOHO_HEAD_LEFT | Value between 0 - 5 0 - Leave it blank 1 - Include Title 2 - Current Date/Time 3 - Include Page number in the format "Page #" 4 - Include page number in the format "Page # Of #" 5 - CUSTOM - Include custom text in footer |
The header or footer value that needs to be generated for each page at that particular position. |
| ZOHO_HEAD_RIGHT | ||
| ZOHO_HEAD_CENTER | ||
| ZOHO_FOOT_LEFT | ||
| ZOHO_FOOT_RIGHT | ||
| ZOHO_FOOT_CENTER | ||
| Custom Header/Footer value | ||
| ZOHO_HEAD_LEFT_TEXT | Custom text. | If any of the header/footer setting is 5 (.ie, CUSTOM) then the corresponding custom value/text should be passed. |
| ZOHO_HEAD_RIGHT_TEXT | ||
| ZOHO_HEAD_CENTER_TEXT | ||
| ZOHO_FOOT_LEFT_TEXT | ||
| ZOHO_FOOT_RIGHT_TEXT | ||
| ZOHO_FOOT_CENTER_TEXT | ||
To export in IMAGE format, in query parameters, the value for ZOHO_OUTPUT_FORMAT should be IMAGE. You can only export Charts in Image format.
Additional parameters (preferably to be sent in the body of the POST request).
|
Parameter
|
Possible Values
|
Description
|
| ZOHO_WIDTH | <number> | The width of the image . |
| ZOHO_HEIGHT | <number> | The height of the image |
| ZOHO_TITLE | true / false |
Controls whether the title of the report is to be added to the image. true - Include the title. |
| ZOHO_DESCRIPTION | true/false |
Controls whether the description of the report is to be added to the image. true - Include the description. |
| ZOHO_SHOWLEGEND | true / false |
Controls whether the legend is to be included in the image generated. true - Include the legend in the image. |
| ZOHO_IMAGE_FORMAT | png / jpg | The format of the exported image. It could be either in PNG or JPG formats. |
Zoho Reports API supports Callback function for handling API responses asynchronously. This is supported in Export API calls, when the output format is chosen as JSON.
The Export API method call, with JSON output format, supports an additional parameter called ZOHO_CALLBACK_FUNCTION to enable callback. Using the Callback function, developers can invoke the Export API request inside the <script> tag and process the JSON response using the CALLBACK function elsewhere in the JavaScript code on the page.
Example:
1) Define the callback function
2) Invoke the api request with output format as JSON and ZOHO_CALLBACK_FUNCTION=sampleFunction
When the page is loaded, the response will be returned as,
Zoho Reports has implemented the Zoho CloudSQL technology as an extension to its HTTP Web API. Using the Zoho Reports HTTP API, users can query the database by providing SQL queries.
Refer to the documentation on Zoho Reports CloudSQL for more details on how to use SQL SELECT query to fetch data from Zoho Reports.
|