Parameter Query for Any Table in the Database

  • Last update:June 13, 2025
  • Overview

    Version

    Report Server VersionFunctional Change
    11.0/

    Expected Effect

    You can select a table name and click Query to display the corresponding content of the table, as shown in the following figure.

    Implementation Method

    You can use the TABLEDATAFIELDS() formula to obtain the column name of each column in the dataset.

    You can use the ds1.select() formula to obtain the content of the corresponding column. For details about the use of the ds1.select() formula, see Overview of Dataset Functions.

    Procedure

    Data Preparation

    Choose File > New General Report in the FineReport designer, and create a dataset ds1 with the SQL statement select * from ${table}, as shown in the following figure.

    Template Design

    1. Right-click cell A1, choose Cell Element > Insert Formula, enter the formula TABLEDATAFIELDS("ds1"), and click OK, as shown in the following figure.

    3.png

    2. Right-click cell A2, choose Cell Element > Insert Formula, enter the formula ds1.select(A1), and click OK, as shown in the following figure.

    3. Set the expansion direction of cell A1 to Horizontal and the expansion direction of cell A2 to Vertical. For example, the following figure shows the steps of setting cell A1.

    5.png

    Parameter Panel

    1. Add the parameter table on the parameter panel, as shown in the following figure.

    2. Select Drop-down Box Widget for the widget and enter sale in Widget Value.

    Set Type to Formula and enter the formula TABLES("FRDemo") for Actual Value in Data Dictionary, as shown in the following figure.

    Preview Effect

    PC

    Save the template and click Pagination Preview. The effect is the same as that shown in section "Expected Effect."

    Mobile Terminal

    The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

    Completed Template

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

    For details, you can download the template Parameter Query for Any Table in the Database.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