Dynamic Column by Functions

  • Last update:February 12, 2025
  • Overview

    Version

    Report Server VersionFunctional Change
    11.0

    /

    Expected Effect

    When a report contains many data columns but a relatively small data volume, you can display data using the dynamic column, as shown in the following figure.

    iconNote:
    This method is not supported when the row-based engine is enabled for the report.

    Screen Recording 2025-02-12 at 11.27.16 (1).gif

    Implementation Method

    You can form a dynamic column using the drop-down checkbox widget and dataset functions.

    Procedure

    Data Preparation

    Create a general report, and create a database query ds1 with the SQL statement SELECT * FROM Sales_Volumn, as shown in the following figure.

    2025-02-06_16-23-26.png

    Table Design

    Design the table as shown in the following figure.

    2025-02-06_16-26-14.png

    Insert =ds1.select(#0) into cell A2 to retrieve all row numbers from the dataset ds1, and set Expansion Direction to Vertical.

    Insert =$colname into cell B1 to obtain the selected column name, and set Expansion Direction to Horizontal.

    Insert =ds1.value(A2,B1) into cell B2 to fetch the value at the specified row and column in the dataset ds1, and set Expansion Direction to No Expansion.

    Adding a Template Parameter

    Choose Template > Template Parameter, add a text-type parameter, and rename it colname, as shown in the following figure.

    iconNote:
    If you want the report to display certain data columns by default, you can set default values for the parameter. For example, you can input Region,Salesperson in Default Value to make the report display the Region and Salesperson columns by default.

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

    Adding the Parameter Widget

    Enter the parameter panel, click Add All in the upper-right Component Setting area to generate the parameter widget, click the widget next to the label widget, and select Drop-down Checkbox Widget, as shown in the following figure.

    2025-02-06_16-33-48.png

    Setting the Data Dictionary for the Parameter Widget

    Select the drop-down checkbox widget (with Widget Name set to colname). On the Data Dictionary configuration page, set Type to Formula, enter TABLEDATAFIELDS("ds1") in Actual Value to obtain all the field names in the dataset ds1, and enter $$$ in Display Value to match actual values, as shown in the following figure.

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

    Effect Display

    PC

    Save the template and click Pagination Preview. The following figure shows the effect.

    Screen Recording 2025-02-12 at 11.27.16 (1).gif

    Mobile Terminal

    The following figure shows the preview effect on the DataAnalyst app and on the HTML5 terminal.

    ScreenRecording_02-11-2025 18-03-26_1 (1).gif

    Template Download

    For details, you can download the template Dynamic Column by Functions.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