Parameter query any table under any data connection

  • Last update:  2021-10-13
  • I. Overview

    1. Application scenarios

    I hope to be able to query the database table information under the data connection through parameters on the report preview page, as shown in the following figure:


    2. Implementation ideas

    • Use the FIELDS() formula to get the field name

    • Use the RECORDS() function to get the field value

    For the introduction and usage of the formula, please refer to the document: Report Function


    II. Example

    1. Parameter setting 

    1) Create a new general report

    ClickTemplate>Template Parameters on the menu bar to create two new template parameters, as shown in the figure below:

    • cone : used to point to the data connection

    • tabl : used to point to the database table


    2) Add the above two template parameters to the parameter panel

    Select the drop-down box widget for the widget type.


    3) Set the data dictionary

    The binding parameter cone corresponds to the data dictionary of the drop-down box widget. The data dictionary type is Custom , and the actual value and display value are filled in as the name of the data connection, as shown in the following figure:


    4) The binding parametertabl corresponds to the data dictionary of the drop-down box widget. The data dictionary type is formula, the actual value is the formula tables($cone) , and the displayed value is the formula $$$ .

    Note: For the use of formulas, please refer to the document:JS Implementation can Automatically Query without Clicking the Query Button 


    2. Report design

    • Design the table as shown below

    • Select cell A1 , insert the formula: FIELDS($cone,$tabl) , and set the expansion direction to Horizontal expansion .  

    • Select cell A2 and insert the formula: RECORDS($cone,$tabl,$a1) , the upper parent cell is A1, and the expansion direction is set to Vertical expansion.

     

    3. Effect preview

    1) PC terminal

    Save the report, click the Pagination Preview , the effect is as shown in the Application scenario.


    2) Mobile


    III. Template download 

    The completed template can be found in: %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Parameter\Parameter_query_data_connection_and_database_table.cpt

    Click to download the template: Parameter_query_data_connection_and_database_table.cpt

    Attachment List


    Theme: Parameter
    • 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