The first value in the default selection list for dropdown box linkage

  • Last update:  2021-11-22
  • I. Overview 

    1) Expected effect

    Linkage of drop-down list of drop-down box parameters can be realized through Drop-down box parameter linkage  In use, the first value in the drop-down list should be selected by default, and the effect is shown in the following figure:

    gif.gif

    2) Implementation roadmap

    The displayed content can be changed by assigning the value of the parameter panel control, combined with SQL function query to query the first parameter corresponding to the value in the database, you can achieve the required results.

    II. Example 

    1. Setting the customer drop-down box widget

    1) Open the template %FR_HOME%\WebReport\WEB-INF\reportlets\doc-EN\Parameter\The_first_value_in the_default_selection_list_for_dropdown_box_linkage.cpt

    2) SELECT the "customer" drop-down box widget in the parameter panel, and select the widget value formula. Enter the formula: SQL ("FRDemoEN","SELECT CUSTOMERID FROM ORDERS ",1,1), so that  the order will be displayed by default during report preview, as shown below:

    1.png


    2.Setting the EMP drop-down box widget

    Select the "EMP" drop-down box widget, and also set the widget value as a formula:

    if(len($Customer)=0,'',sql("FRDemoEN","SELECT EMPID FROM ORDERS where CUSTOMERID= '"+$Customer+"'",1,1))

    As shown below:

    2.png

    Note 1: The sample template uses dynamic SQL to set the data dictionary for the [EMP] drop-down widget. Alternatively, you can skip the dynamic SQL method and directly add the formula to the data dictionary setting dialog box: sql('FRDemoEN','SELECT EMPID FROM ORDERS where CUSTOMERID="'+$Customer+'"',1)

    Note 2: Note the use of single and double quotation marks. In the first case, like "% XXX "becomes like '% XXX '.

    3.Setting the Ship drop-down list widget

    Select the "Ship" drop-down box widget and also set the widget value to the formula: 

    if(len($Customer)=0||len($EMP)=0,"",sql("FRDemoEN","SELECT SHIPMETHOD FROM ORDERS where CUSTOMERID = '"+$Customer+"' and EMPID = '"+$EMP+"'",1,1))

    4.png

    Note 1: The sample template uses dynamic SQL to set the data dictionary for the "Ship" drop-down widget. Alternatively, you can skip the dynamic SQL method and add the formula directly to the data dictionary setting dialog:if(len($Customer)=0||len($EMP)=0,'',sql('FRDemoEN','SELECT SHIPMETHOD FROM ORDERS where CUSTOMERID="'+$Customer+'" and EMPID="'+$EMP+'"',1,1))

    Note 2: The SQL assigned to the widget value must match the corresponding widget data dictionary query, otherwise the result may be wrong

    III.Effect preview

    1) PC

    See section I of this article.

    2) Mobile

    Support app and HTML5 view

    IV. Download the template

    For the completed template, see %FR_HOME%\WebReport\WEB-INF\reportlets\doc-EN\Parameter\The_first_value_in the_default_selection_list_for_dropdown_box_linkage.cpt

    Click to download the template: 

    The_first_value_in the_default_selection_list_for_dropdown_box_linkage.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