Direct URL Export (POST Request Method)

  • Last update:February 27, 2024
  • 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
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy