Parameter Query for the Infinite Interval

  • Last update:June 19, 2025
  • Overview

    Version

    Report Server VersionFunctional Change

    11.0

    /

    Application Scenario

    In some reports, most of the data is in the numeric format (such as production values and amounts). To meet such business requirements, you can define infinite intervals on the query panel with comparison operators such as greater than (>) or less than (<), as shown in the following figure.

    动图2.gif

    Implementation Method

    You can define two parameters for the comparison operator and the field whose values are to be queried, respectively. You can define the parameter expression in the database query statement.

    Example

    Data Preparation

    Create a general report and create a data query named ds1 with the SQL statement:

    select * from Sales_Volumewhere 1=1${if(len(fh)=0,"",if(len(sales_volume)=0,"","and Sales_Volume"+fh+"'"+sales_volume+"'"))}

    iconNote: 

    1. Two parameters, fh and sales_volume, exist in the SQL statement. fh is used to set comparison operators, while sales_volume is used to set the field whose values are to be queried. The two parameters are used to bind the corresponding widgets, respectively.

    2. You can realize the effect that all values are selected when the parameter values are empty by the statement.

    Table Design

    Design the table as shown in the following figure and drag the fields from the dataset into the corresponding cells.

    Widget Setting

    1. Enter the editing page of the parameter panel, bind the parameters fh and sales_volume to the corresponding widgets, respectively, select Drop-down Box Widget for fh, and select Text Widget for sales_volume, as shown in the following figure.

    2. Select the drop-down box widget and customize the data dictionary of the widget on the right attribute panel, as shown in the following figure.

    Effect Display

    1. PC

    Save the report and click Pagination Preview. The following figure shows the query effect.

    动图1.gif

    2. Mobile Terminal

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

    动图2.gif

    Template Download

    For details, you can download the template Parameter Query for the Infinite Interval.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