Widget dynamic default value

  • Last update:  2021-10-08
  • I. Overview

    1. Problem description

    It is hoped that the default value of the widget is not fixed, but is dynamically obtained based on database data. For example, get the maximum value in a column.


    2. Solutions

    Use report-like functions to get the database data, and do some custom processing, as the default value of the widget.

     


    II. Example 

    1. Data preparation

    Create a new ds1 data set, fetch the data from FRDemo, enter the sql statement: SELECT * FROM SaleRental



    2. Report design 

    Add a drop-down box widget in theTemplate Parameter, the data dictionary is bound to ds1, the actual value and the displayed value are both Sales Volume.


    3. Default value setting 

    Select the drop-down box widget, select the Formula in "Widget Settings>Attributes>Advanced>Widget Value", and enter the following formula: max(value("ds1","Sales Volume"))


    4. Effect preview

    Click Preview, you can see that the drop-down box defaults to the maximum value of 2261.0.

     

    III. Template download

    Click to download the template: Widget_dynamic_default_value.cpt

    IV. Precautions

    In addition to the above scheme, you can also directly use SQL to retrieve the maximum value in the data set, and then set the default value of the widget to the field value of the data set.

    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