Successfully!

Error!

Direct URL Export (POST Request Method)

  • Last update:  2024-02-27
  • Overview

    Problem

    The document Direct URL Export provides you with a data export method through the GET request. This document introduces how to export data through the POST request.

     4.gif

    Implementation Method

    You can export data with the POST request method through the built-in function doHyperlinkByPost in FineReport.

    The following table describes the function doHyperlinkByPost.

    Method

    Parameter

    Type of the Returned Value

    Description

    doHyperlinkByPost(url,config,tar get,feature)

    url (mandatory): specifies a URL or a JSON Hyper-Schema definition.

    config (optional): specifies a parameter to be passed.

    target (optional): specifies the position where the hyperlink subpage is opened.

    feature (optional): specifies the attribute of the position where the hyperlink is opened.

    void

    Returns a hyperlink. Through this method, the system passes the config parameter through the POST request, displays the result in target, and sets window attributes in feature.

    iconNote:
    You can refer to this document to export data through the POST request in dashboards after the Dashboard Export plugin has been installed. For details, see Dashboard Export Plugin.

    Example

    Template Preparation

    Create a general report, add a button widget on the parameter panel, and name the button Export.

     2.png

    Click Event Adding

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

     3.png

    JavaScript codes are 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 indicates the export method. You can refer to the document Exporting a Report Directly Through a URL.

    Effect Display

    On PC

    Save the template and click Pagination Preview. The preview effect is shown in the following figure.

     4.gif

    On Mobile Terminals

    Save the template, click Mobile Preview, and copy the link, as shown in the following figure.

     5.png

    Open the mobile browser, paste the link, and click Export. The following figure shows the effect.

     6.png

    The following figure shows the effect of the opened file.

     7.png

    Template Download

    Attachment List


    Theme: Report Application
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback