I.Overview
1.Application scenarios
The existing folding tree report can only take effect in op=view preview mode. How to use the condition attribute to generate a general folding tree report, the effect is shown in the following figure:
2.Implementation ideas
Save the clicked group serial number in the parameter, and then judge whether there is the group in the parameter to realize the display and hiding.
II.Example
1.Report design
Create a new data set ds1, the database query statement is: SELECT * FROM SELECT * FROM Sales_Volume
Design the table as shown in the figure below, set the cell data of B2 as a list, and set the left parent cell as A1.
Select cell A1 and add a dynamic parameter type hyperlink to the cell. The parameter settings are as follows:
The parameter name is: a
The parameter value is:IF(LEN($a) = 0, &A1, if(inarray(&A1, split($a, ",")) > 0, joinarray(GREPARRAY(split($a, ","), item != &A1), ","), $a + "," + &A1))
4)Select cell B2 and add a condition attribute of row height type to the cell, the formula is as follows:
When inarray(&A1, split($a, ",")) > 0, the row height is 5
5)Add another condition attribute of row height type to cell B2, the formula is as follows:
Wheninarray(&A1, split($a, ",")) = 0,the row height is0
2. Effect preview
PC terminal
Save the report, click the page to preview, the effect is as shown in the figure below:
Mobile
III.Template download
Click to download the template:Conditional Attributes to Achieve a Collapsed Tree.cpt