Expanding/Collapsing a crosstab
If a crosstab has more than one row/column group level, you can specify whether or not to enable the crosstab to be expanded at runtime, and set the default expanding/collapsing state of groups in outer level. This behavior is controlled by two properties: Expand Data and Expand Detail Data.
- Expand Data: A property on both crosstab, and DBField or formula added into crosstab as dimension (group level). The property on crosstab controls whether or not to enable end users to expand/collapse dimensions in a crosstab, and when it is enabled, you can use the property on certain DBField or formula to specify whether this dimension can be expanded/collapsed respectively.
- Expand Detail Data: A property on DBField or formula added into the crosstab as dimension (group level). It specifies whether or not to display the details of this field by default.
Note: These two properties works only in continuous page mode, and after setting the two properties, if you have further modified the crosstab layout, they may not take effect.
The following example shows how to use the two properties:
- Create a crosstab report on the query WorldWideSales in the catalog file SampleReports.cat as follows: add Product Type Name and Category in the Products table as the column fields, Region, Country and State in the Customers table as the row fields, Quantity in the Orders Detail table as the aggregate field and specify Sum as the aggregate function, set the crosstab to be Vertical Layout (Number of Rows: 1), and apply the style Classic to the crosstab.
- In the Report Inspector, set the Expand Data property of the crosstab to true.
- Set the Expand Data property of the DBField Country to false, and the Expand Detail Data property of the DBField Product Type Name to false.
- Uncheck Page Layout on the View menu.
- Save the crosstab.
- Click View > Preview As > Page Report Result to preview the report. You can then click the buttons with a plus or minus sign to expand/collapse the Region and Product Type Name dimensions, and since the Expand Detail Data property of Product Type Name is set to false, you will find the details of this dimension are not expanded by default.