Dynamic Column by a Condition Attribute

  • Last update:February 12, 2025
  • Overview

    Version

    Report Server VersionFunctional Change
    11.0

    /

    Expected Effect

    Dynamic column allows you to use column names as parameters and display specific columns by selecting the required column names in the drop-down checkbox widget and clicking the Query button, as shown in the following figure.

    Screen Recording 2025-02-07 at 15.34.13 (1).gif

    Implementation Method

    You can form a dynamic column by hiding specific columns using Condition Attribute.

    Example

    Data Preparation

    Create a general report, and create a database query ds1 with the SQL statement SELECT * FROM Sales_Volume where Product='Milk', as shown in the following figure.

    2025-02-06_16-01-55.png

    Table Design

    Drag the fields into the corresponding cells, as shown in the following figure.

    2025-02-06_16-05-12.png

    Widget Adding

    1. Add a label widget, a drop-down checkbox widget, and a query button widget to the parameter panel, as shown in the following figure. /

    • Set Widget Value of the label widget to String, and enter Column Name:.

    • Set Widget Name of the drop-down checkbox widget to Column Name.

    2025-02-07_15-32-46.png

    2. Configure Data Dictionary of the drop-down checkbox widget, as shown in the following figure.

    2025-02-06_16-13-08.png

    Condition Attribute Adding

    Select cells from A1 to E1, and add a condition attribute to set the column width to 0 mm when the current value is not in the values of the Column name parameter, as shown in the following figure.

    2025-02-07_15-38-06.png

    Effect Display

    PC

    Save the report and click Pagination Preview. The effect is shown in section "Expected Effect."

    Mobile Terminal

    The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

    ScreenRecording_02-12-2025 11-56-06_1 (1).gif

    Template Download

    For details, you can download the template Dynamic Column by a Condition Attribute.cpt.

    Attachment List


    Theme: Parameter
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    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