Template Parameter

  • Last update:May 09, 2025
  • Overview

    Application Scenario

    You can query the parameter information by using the widget bound to the template parameter. 

    For example, entering a specific region in the text box allows you to query the data for that specific region. 

    You can enter California in the text box, and click the Query button to view the sales information for California in the report, as shown in the following figure. 

    1.png

    You can enter New York in the text box, and click the Query button to view the sales information for New York in the report, as shown in the following figure. 

    2.png

    Function Description

    1. Template parameters are specific to the current report and need to be used in conjunction with the filtering conditions of the data columns.

    2. Template parameters are suitable for a small amount of data. You can retrieve all data through the dataset, then set the template parameters in the report, and use these template parameters to filter out useful data during data queries.

    iconNote:

    1. For a large amount of data, you can use the Dataset Parameter to filter data.

    2. Template parameters do not support the Value function by default.

    Example

    Template Creation  

    Create a general report, as shown in the following figure. 

     3.png

    Data Preparation 

    Create a dataset named ds1, and enter the SQL query statement SELECT * FROM Sales_Volume in the database query dialog box to retrieve all data from the table Sales_Volume, as shown in the following figure.
    4.png

    Report Design

    1. Enter text into cells A1 to C1, drag corresponding data columns into the cells, and design the report as shown in the following figure.

    5.png

    2. Select cell C2, click Cell Element on the right attribute panel, and select Summary and Sum from the drop-down list of Data Setting, as shown in the following figure.

     6.png

    Template Parameter Defining

    1. Choose Template > Template Parameter on the designer menu bar to bring up the setting dialog box. Click the Add button to create a template parameter, double-click the parameter, rename it Region, and set Default Value to California, as shown in the following figure. 

     7.png

    2. Double-click the original name to enter edit mode if you want to modify the template parameter name, and click OK after modification, as shown in the following figure.

     Gif8.gif

    Parameter-Widget Binding

    1. Click the 编辑按钮.png button on the parameter panel to enter the parameter panel editing page. Click Region or Add All to add the parameters displayed on the Component Setting panel in the upper right corner to the parameter panel, as shown in the following figure.

    iconNote:
    Parameters are bound to widgets based on the parameter names. This means that when the widget names match the parameter names, the parameters and widgets are automatically bound. Assigning a value to the widget on the web terminal is equivalent to assigning a value to the parameter.

    Gif9.gif 

    2. Click the 编辑按钮2.png button of the custom widget, and select Text Widget. The parameter is bound to the text widget, as shown in the following figure.

    iconNote:
    If you do not want to click Add All or Parameter shortcut button to add default widgets, you can drag widgets directly from the widget panel to the parameter panel. You can bind widgets to parameters by modifying the widget names to match the parameter names.

    Gif10.gif

    3. Drag the Query button to the left to create a compact layout, making the widget panel more aesthetic, as shown in the following figure.

    11.png

    4. Click the 编辑按钮.png button on the parameter panel again to complete the settings for the parameter panel, and return to the report design page, as shown in the following figure.

     Gif12.gif

    Data Filtering Setting

    After setting up the widgets, you still cannot query the sales information for the specified region by entering parameter values in the text box. Since the table data is retrieved from the dataset ds1, which retrieves all data from the database, you need to add filter conditions to the table in order to query information by entering parameter values in the widget.

    Double-click cell A2,click Filter in the pop-up dialog box Data Column, and add a common condition. Set the Available Column to Region and Operator to Equal to, select Parameter and $Region in the drop-down list, and click the Add button and then OK. In this way, you can then bind the region cell to the parameter, as shown in the following figure.

    iconNote:

    When the parameter is empty, the query results will also be empty. For details about how to retrieve all data when the parameter is empty, see When Value of Drop-down Box is None, Show All Data.

    13.png

    Effect Display

    1. PC

    Save the report and click Pagination Preview.

    Enter California in the text box andclick the Query button to view the sales information for California in the report, as shown in the following figure.

     1.png

    Enter New York in the text box and click the Query button to view the sales information for New York in the report, as shown in the following figure.

     2.png

    2. Mobile Terminal

    The effect and be previewed on both the DataAnalyst app and HTML5 terminal

    Enter California in the text box and click the Query button to view the sales information for California in the report, as shown in the following figure.

     14.png

    Enter New York in the text box and click the Query button to view the sales information for New York in the report, as shown in the following figure.

    15.png

    Template Download

    For details, you can download the template:Template Parameter.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