### 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(s). This behavior is controlled by two properties: Expand Data and Expand Detail Data.

- Expand Data: This is a property on crosstab. It specifies whether or not to enable end users to expand or collapse dimensions in the crosstab.
- Expand Detail Data: A property of DBField or formula added into the crosstab as dimension (group level). It specifies whether or not to display the details of this field.

The following example shows how to use the two properties:

1. 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, 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.
2. In the Report Inspector, set the Expand Data property of the crosstab to true, and set the Expand Detail Data property of the DBField Country to false.
3. Uncheck Page Layout on the View menu.
4. Save the crosstab.
5. Click View > Preview As > DHTML to preview the report in DHTML format. You can then click the corresponding buttons with a plus or minus sign to expand/collapse data in the crosstab.

   See the result.

Notes:

- If you have modified the crosstab layout, the two properties may not take effect.
- The two properties are not supported in pagination mode.