Cell drop down tree returns the displayed value

  • Last update:  2022-01-13
  • I. Overview

    1.Problem description

    Add Drop_down tree widget in cell, data dictionary set actual value and display value, select the display value, after the out-of-focus cell will display the actual value.

    For example, the following figure shows the department structure in the drop-down tree. The actual value of the option is the department ID, and the displayed value is the department name. It can be seen that the actual value in the drop-down tree box changes after the out-of-focus.

    So how do you make it out of focus and still show up as a display value and commit it to the library?

    1.gif

    2. Solution

    The Cell Attributes>Data Dictionary sets the relationship between the actual value and the display value, so that the final display value after out of focus can be achieved. MAPARRAY() and VALUE() functions are used to convert the actual VALUE into the library.

    II. Example 

    1. Preparing data

    1) Create a general report and add dataset ds1. The SQL statement is SELECT * FROM CorporationDepartment

    1.jpg

    2) Then add tree dataset tree1 and select ds1 as shown below:

    2.jpg


    2. Adding a drop-down tree

    Add a drop-down tree widget in cell A1, select Automated Build data dictionary construction mode, the actual value is the DepartmentID, display value is the Department_name. Set to multiselect and uncheck Return full hierarchical path. As shown below:

    3.jpg


    3. Cell configuration setting

    Select cell A1, select data dictionary in Cell Attributes > Display, bind ds1 dataset, the actual value is the DepartmentID, the displayed value is the Department_name.

    4.jpg


    4. Data Entry Attributes Settings

    After the above setting, the out-of-focus display is already the displayed value, but the value obtained by submitting the bound cell in the library at this time is still the actual value. Here you can use the formula to process: array(A1,value("ds1","Department_name","DepartmentID",item)), where the array function is used to create a new array, and the Value function is used to list and the one-to-one department name of the department ID in cell A1.    

    6.png

    Note: If you want to concatenate the result and store it in a database as a string, you can change the formula:JOINARRAY(maparray(A1,value('ds1',' Department_name ',' DepartmentID',item)),',')


    5. Effect preview

    7.gif

    III. Download the template

    Completed template see: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Cell_drop_down_tree_returns_the_displayed_value.cpt

    Click to download the template: 

    Cell_drop_down_tree_returns_the_displayed_value.cpt


    Attachment List


    Theme: Data Entry
    • 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