Global and Template Parameter

  • Last update:June 14, 2023
  • I. Overview

    1) Parameter is a type of variable and the value is determined by users. The values of parameters are used to filter report data (if used with filters). In FineReport, you can bind a parameter with a widget on the parameter pane. In this way, during the preview, report users can utilize the widgets to define parameter values and filter data; and this process is called parameter query.

    2) Global parameter: It can be used by all templates in the same report project.

    3) Template parameter: It can only be used by current template. If multiple templates have parameters with the same name , the parameter values will not affect each other.

    4) In a template, if there exists a template parameter that shares the same name with a global parameter, the system only recognizes the template parameter.

    You will learn
    • Define Global Parameters

    • Define Template Parameters

    II. Define global parameters

    1. Click [Server] > [Global Parameters]


    2. Click [+] to add a global parameter, with the default name [p1]

    The default type is [String].


    3. Double click [p1] to modify the name to area


    4. Set the default value to East China and click [OK]


    5. Click the pen icon to edit the parameter pane


    6. A hint appears at the upper right corner, stating that the parameter [area] has not been bound with widgets on the parameter pane


    7. Create a new normal report

    1) Click the pen icon to edit the parameter pane.

    2) A hint also appears at the upper right corner, stating that the parameter [area] has not been bound with widgets on the parameter pane. In other words, two template files can share [area].


    8. Click the pen icon to edit the report area


    9. Click B2 and insert a formula

    1) Find Global Parameters in the list of Variables and double click $area. Click [OK].

    2) Preview to view the value of [area].

    III. Define template parameters

    1. Click [Template] > [Template Parameter]


    2. Click [+] to add a global parameter, with the default name [p1]

    The default type is [String].


    3. Double click [p1] to modify the name to area


    4. Set the default value to North China and click [OK]


    5. Click the pen icon to edit the parameter pane


    6. A hint appears at the upper right corner, stating that the parameter [area] has not been bound with widgets on the parameter pane


    7. Click the pen icon to edit the report area


    8. Click B2 and insert a formula.

    1) Find Template Parameter in the list of Variables and double click $area. Click [OK].

    2) Preview to view the value of [area].

    3) If a template parameter and a global parameter share the name, then the template parameter overrides the global parameter.


    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