Overview
Version
Report Server Version | Functional 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.
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.
Table Design
Drag the fields into the corresponding cells, as shown in the following figure.
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.
2. Configure Data Dictionary of the drop-down checkbox widget, as shown in the following figure.
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.
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.
Template Download
For details, you can download the template Dynamic Column by a Condition Attribute.cpt.