Creating a crosstab based on a business view
Creating a crosstab based on a query resource
With the crosstab wizard, it is easy to create crosstabs in a report, however the wizard varies with the data resource type used for the crosstab: business view or query resource.
A web report and library component can only use business views. For a page report it can be created either based on query resources or business views, which is determined at the time when the page report is created by the Create Using Business View option. Once defined, all the data components in the page report can only be created on the specified data resource type.
A crosstab can be inserted in the report areas listed in Component placement. When it is inserted into a banded object, you can use a data container link to define the relationship between the crosstab and its parent.
from the Grid category of the Components panel to the report.The Create Crosstab wizard appears, which contains a set of screens for helping you define a crosstab easily. You can use the Back and Next buttons or click the screen name on the screen navigation bar to switch between the screens.


The Resources box lists the view elements in the specified business view and the dynamic formulas and aggregations created for the business view in the current report. You can use these objects to create the crosstab.
or dynamic formulas used as Group
as column/row fields to display on the column and row headers of the crosstab. You can add an object using either the button beside the target box or by dragging it from the Resources box to the target box.
For each column/row field, you can double-click in the Label text box and input a name to label the corresponding column/row header, or check the Auto Map Field Name checkbox in the text box if you want to automatically map the label text to the dynamic display name of the field at runtime (by default the Label text box is blank and no label will be created for the column and row headers in a crosstab); double-click in the Color text box to specify its background color (to make the color take effect you need to edit the Background property of the field to Transparent in the Report Inspector after the crosstab is created); click
to change the sort manner of its values between Ascend, Descend and No Sort. To adjust the display order of the column/row fields on the column/row headers, select a field and click
or
; to remove an unwanted column/row field, select it and click
or drag and drop it to the Resources box.
, detail objects
, dynamic formulas used as Aggregation
, dynamic formulas used as Detail
or dynamic aggregations
as aggregate fields to create aggregations in the crosstab. You can add an object using either the button
or by dragging it from the Resources box to the Summaries box. When a detail object is added as aggregate field, double-click in the Aggregate text box to specify the aggregate function for it.
For each aggregate field, you can double-click in the Label text box and input a name to label the corresponding aggregations in the crosstab, or check the Auto Map Field Name checkbox in the text box if you want to automatically map the label text to the dynamic display name of the field at runtime (by default the Label text box is blank and no label will be created for the aggregations in a crosstab); click the Comparison Function button to define a comparison function for it. To adjust the display order of the aggregate fields, select a field and click
or
; to remove an unwanted aggregate field, select it and click
or drag and drop it to the Resources box.
An aggregate field can generate detail aggregations, aggregations for subtotals and aggregations for grand totals for each combination of the column and row fields.



When you have specified to insert the crosstab into a banded object, by default the crosstab will inherit its parent's style. If you want to apply another style to the crosstab, uncheck the Inherit Style option and then select the required style from the Style box.
If you have selected a panel in a banded object as the crosstab destination, after finishing the wizard you need to click the mouse button in the destination once again in order to insert the crosstab there.
Using query resources, you can create compound crosstabs. A compound crosstab contains multiple crosstabs that are mashed up together in a flexible way. Aggregations can be created based on any combinations of the row and column compound groups, making more complex analysis possible.
The Create Crosstab wizard appears, which contains a set of screens for helping you define a crosstab easily. You can use the Back and Next buttons or click the screen name on the screen navigation bar to switch between the screens.

If the predefined data resources are not what you want, you can click the first item in the corresponding resource node to create one in the current catalog. When a query is selected, click the Edit button to modify the query if required. Then a new dataset based on the selected data resource is created in the page report.
If you want to use an existing dataset in the current page report to create the crosstab, click the More Options button and then:

The Resources box lists the DBFields in the specified data resource as well as the formulas that are valid to these DBFields in the current catalog. You can create the crosstab using these fields. If the predefined formulas cannot meet your requirement, you can click <New Formula...> in the Formulas node to create the formulas you want.
or
, or drag and drop it from the Resources box to the target box. If you want to display compound column/row groups in the crosstab, click
at the right bottom corner of the Columns/Rows box to create them, then select each compound group and add the required fields to it.
For each column/row field, you can double-click in the Label text box and input a name to label the corresponding column/row header (by default the Label text box is blank and no label will be created for the column and row headers in a crosstab); double-click in the Color text box to specify its background color (to make the color take effect you need to edit the Background property of the field to Transparent in the Report Inspector after the crosstab is created); click
to change the sort manner of its values between Ascend, Descend and No Sort. To adjust the display order of the column/row fields on the column/row headers, select a field and click
or
; to remove an unwanted column/row field or compound group, select it and click
or drag and drop it to the Resources box. The display order of the compound groups can also be adjusted by selecting a compound group and clicking
or
; to remove a compound group, select it and click
.
or drag and drop to the Summaries box. You can also click <New Crosstab Formula...> in the Crosstab Formulas node to create crosstab formulas to use as the aggregate field. When a DBField or formula is added as aggregate field, double-click in the Aggregate text box to specify the aggregate function for it. If you have created compound column and row groups in the crosstab, you can add aggregate fields for each combination of the compound groups by selecting a row/column group and a column/row group and then adding the required fields.
For each aggregate field, you can also double-click in the Label text box and input a name to label the corresponding aggregations in the crosstab (by default the Label text box is blank and no label will be created for the aggregations in a crosstab); click the Comparison Function button to define a comparison function for it. To adjust the display order of the aggregate fields, select a field and click
or
; to remove an unwanted aggregate field, select it and click
or drag and drop it to the Resources box.
An aggregate field can generate detail aggregations, aggregations for subtotals and aggregations for grand totals for each combination of the column and row fields.



When you have specified to insert the crosstab into a banded object, by default the crosstab will inherit its parent's style. If you want to apply another style to the crosstab, uncheck the Inherit Style option and then select the required style from the Style box.
If you have selected a panel in a banded object as the crosstab destination, after finishing the wizard you need to click the mouse button in the destination once again in order to insert the crosstab there.
Besides using the wizard, you can also drag a blank crosstab to a page report that is created using query resources. To do this:
to the destination in the page report which allows the insertion of a crosstab. A blank crosstab is then created.<install_root>\Demo\Reports\SampleReports.
in the Rows box and two compound row groups appear in the box.


in the Columns box, then add the formula Quarter to Column Compound Group and the field Order ID in the Orders table to Column Compound Group 1, specify their labels as Quarter and Order ID.


