View Categories

Dynamic folding

< 1 min read

You may need to view your report compactly. Stimulsoft reports have the ability to dynamically collapse information in the preview window. A dynamically collapsible report is an interactive report in which collapsed blocks can be expanded or collapsed by clicking on the block title. Dynamic folding is commonly used in grouped, master-detail, and hierarchical reports. Dynamic collapsing can be multi-level. Consider the use case of dynamic folding in a report. Suppose you have a report with a list of products grouped by category. The figure below shows a schematic representation of a report with multi-level collapsibility.

As can be seen from the figure, collapsible unit A contains collapsible blocks B1, B2, and B3. This is the first stage of dynamic collapsing. B1 then has blocks C1, C2, and C3. This is the second level of dynamic collapsing, and so on. Consider the example of dynamically collapsing a report by group. Suppose you have a report with a list of products grouped by category. Below is an image with a grouped report.

Enable dynamic folding and make the title of the folding unit the group title, in this case the category name. To do this, go back to the report template (see image).

Select the component that will be the title of the folding block, in this example the Group Header band. Then set the Interaction.Collapsed Enabled property to true. In the field of the Interaction.Collapsed property, enter the expression {GroupLine! = 1}. Render the report. Below is a report page rendered with dynamic collapsing.

Now when the report is rendered, the group will appear to grow and shrink like a block. You have to click on the title block to expand/collapse the block. In this case, it's the header of the group. Components with dynamic folding enabled display an icon when the block is collapsed and an icon when the block is expanded. Note that you can collapse blocks in the group footer. To do this, set the Interaction.Collapse Group Footer property to true.