Overview
Description
The document Direct Report Export by URL instructs you on exporting a report via the GET request method. This document introduces how to export a report using the POST request method.

Implementation Method
You can export a report with the POST request through the doHyperlinkByPost API provided by FineReport.
API Description
| Method | doHyperlinkByPost(url,para,target,feature) | Opens a webpage using the POST request method, allowing you to pass parameters and set page attributes. |
|---|---|---|
| Parameter | URL: object para: object target: object feature: object | URL: URL or JSON hyperlink (required) An example of supported absolute URLs: http://192.168.100.1:8080/webroot/decision/view/report?viewlet=GettingStartedEN.cpt An example of supported relative URLs: /webroot/decision/view/report?viewlet=GettingStartedEN.cpt para: The parameter to be passed (optional) target: The location to open the hyperlink (optional) _dialog: Dialog box _self: Current page Name of a certain iframe, which will be opened on the current page, and submitted using the POST request method feature: Attribute of the hyperlink opening location (optional) Note: |
| Return Value | void | |
| Mobile Terminal | The API is supported on mobile terminals. | |
Note: Example
Template Preparation
Create a general report, add a button widget on the parameter panel, and name the button Export.

Click Event Adding
Select the button widget and add a click event, as shown in the following figure.

The JavaScript code is as follows:
var url="${servletURL}?viewlet=GettingStartedEN.cpt"
var config = {
Region : "New York",
format:"excel"
}
FR.doHyperlinkByPost(url,config,_blank,"_self")
The value of the format parameter represents the export method. For details, see Direct Report Export by URL.
Effect Preview
Save the report and click Pagination Preview. The following figure shows the preview effect.

Note: Template Download
You can click to download the template: Direct Report Export by URL (POST Request Method).cpt