Successfully!

Error!

Dataset Parameter

  • Last update:  2020-11-30
  • I. Overview

    1) Dataset parameters are used when creating DB Query datasets, their values are also used to filter data. Since the filtering process is completed when creating a dataset, using dataset parameters helps to improve the loading speed of reports and occupy less memory resources comparing to global parameters and template parameters.

    2) If bind a dataset parameter and a widget on the parameter pane, during the preview, report users can utilize the widget to define parameter value and filter data, and this process is parameter query.

    3) Dataset parameters can only be used by current template.

    4) FineReport owns a set of SQL statements to define dataset parameters specifically. During the use, you need to care about the data type of the parameter (e.g. the statement to define a string type parameter is different from that to define numeric type parameter).

    You will learn
    • Define dataset parameters

    • Add dataset parameters of different data types

    II. Steps

    1. Create a new dataset [ds1]

    1) Create a new DB query dataset.

    2) Input the SQL statement:

    SELECT * FROM Sales_Volume WHERE Region = '${region}'


    2. Click the refresh button to view the dataset parameter defined in the SQL

    1) Name of the parameter: region, default type: String.

    2) Set the default value of the parameter to East China.


    3. Preview the dataset

    1) Click Preview. The pop-up parameters setting dialogue box displays the default value of the parameter. Click [OK].

    2) The data in [ds1] is filtered.


    4. Modify the SQL statement of [ds1] to:

    SELECT * FROM Sales_Volume WHERE Region = '${region}'AND Sales_Volume > ${limit}

    5. Click the refresh button to view the dataset parameter defined in the SQL

    1) Name of the new parameter: limit.

    2) Modify the type to Integer. Input the default value: 200.


    6. Preview the dataset. The data in [ds1] is filtered


    7. Click the pen icon to edit the parameter pane


    8. A hint appears at the upper right corner

    This indicates that parameters [limit] and [region] have not been bound with widgets on the parameter pane.


    Attachment List


    Theme: Parameter
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback