Drop-down tree widgets are selected all by default

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

    1) Problem description

    The current multi-select drop-down tree does not have the function of selecting all. Therefore, selecting all is troublesome when there are many root nodes. So how to achieve the default full selection of the multi-selection drop-down tree?

    2) Implementation roadmap

    The default values of the multi-select drop-down tree are in the following formats: Headquarters, Finance department, Director; Headquarters, Finance department, accounting. You can concatenate several columns of a drop-down tree data dictionary in SQL to construct a default value format. Then use the JoinArray () function in the widget value to concatenate a string as the default value.

    Note: This scheme has some limitations on the data structure, so it needs to write SQL to output the field values that meet the format requirements of the default values of the drop-down tree.

    II. Examples

    1. Preparing data

    SQL statement: SELECT Country FROM Client where Country!=''

    1.jpg

    SQL statement: SELECT  Region FROM Client where Region!='' and Country='${layer1}'

    2.jpg

    Dataset ds3, according to the first two layers of layer1, layer2 value query city, SQL statement is:SELECT  City FROM Client where City!='' and Country = '${layer1}'and Region='${layer2}'

    3.jpg

    Note: This is referenced by layer1, Layer2, and so on. Layer1 and Layer2 are predefined and cannot be changed.


    2. Report design

    1) Drag the parameter panel into the drop-down tree widget.

    4.jpg

    2) Select the Attribute>Advanced>Data Dictionary, the construction method of ordinary layered construction, select the dataset corresponding to each layer.

    Level 1:

    Level 2:

    Level 3:


    3. Concatenate to build defaults

    1) Create a new dataset ds4, SQL statement is: select Country||','||Region||','||City from Client where Country !="" and Region !="" and City !=""

    Note: You need to modify the SQL as required and output the complete path of each node value. If the return leaf node is set, the SQL concatenated node cannot have a directory node.

    2) Select the widget from the drop-down tree and enter the following formula in Widget Settings>Attributes>Advanced > Widget Value.Enter the following formula:JOINARRAY(Value (" ds4 ",1),";" )

    9.jpg


    4. Effect preview

    Save the template and click Pagination Preview. The effect is as follows:

    10.jpg

    III. Download the template

    The template has been completed, please refer to: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Drop-down_tree_widgets_are_selected_all_by_default.cpt

    Click to download the template: 

    Drop-down_tree_widgets_are_selected_all_by_default.cpt


    Attachment List


    Theme: Parameter
    Already the First
    • 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