Radio button groups widget whether the implementation displays all

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

    1) Requirement description

    In a real project, you may need to control the display of the template in full or in part. In the following figure, if Yes is selected, the query result contains information about both the department ID and the upper-level department ID.

    gif1.gif

    2) Implementation roadmap

    Radio button group widgets and data set parameters to achieve.

    II. Steps

    1. Preparing data

    Create a general report, create a dataset ds1, SQL statement:

    SELECT * FROM CorporationDepartment where 1=1 ${if (flag == 0,"and DepartmentID = '" + id + "'","and (DepartmentID = '" + id + "' or SuperiorID='" + id + "')")}

    1.jpg


    2. Table design

    Design the table as shown below and drag the fields into the corresponding cells:

    2.jpg


    3. Adding parameter widgets

    Edit the parameters panel, click Add All above the widget Settings on the right to generate the parameterswidget. Click the id parameter box, select the Drop-down box widget; Click the flag parameter box and select the radio button group widget.

    3.jpg


    4. Setting the data dictionary of the parameter widget

    1) Setting the data dictionary for the drop-down box widget

    Select the widget id from the drop-down list box, set the data dictionary to the Database Table, and select the CorporationDepartment table of the built-in database FRDemoEN. The actual and displayed values are both DepartmentID.

    4.jpg

    2) Setting the data dictionary for the radio button group widget

    Select the radio button group widget named flag, set the data dictionary to Custom, and add two records: the actual value 1 and 0 correspond to the displayed value yes and no respectively.

    5.jpg


    5. Effect preview

    1) PC

    Save the template and click page preview, the effect is as shown below:

    gif1.gif

    2) Mobile 

    The end effect of App and HTML5 is as follows:

    gif2.gif

    III. Download the template

    For the completed template, see:

    %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc\Parameter\Radio_button_groups_widget_whether_the_implementation_displays_all.cpt

    Click to  download the template: 

    Radio_button_groups_widget_whether_the_implementation_displays_all.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