BackPrevious Page Next PageNext

Modifying Crosstabs

Editing a crosstab with wizard

Adding more column/row headers and aggregations to a crosstab

Defining comparison functions in a crosstab

Customizing the layout of a crosstab

Editing a crosstab with wizard

After a crosstab is created, you can further modify it by accessing its shortcut menu wizard which is composed by a set of screens that are similar to the wizard screens used to create the crosstab. For example, you can change the data used by the crosstab, reset the layout and style of the crosstab.

  1. Right-click the crosstab and select Crosstab Wizard from the shortcut menu to display the Crosstab Wizard.
  2. In the Data screen, specify a new data source for the crosstab if required.
  3. In the Display screen, specify the fields you want to display in the crosstab.
  4. In the Layout screen, specify the layout of the crosstab.
  5. In the Style screen, set a style for the crosstab.
  6. Click Finish to accept the changes.

For more detailed information about defining a crosstab, see Inserting Crosstabs in a Report.

Adding more column/row headers and aggregations to a crosstab

Besides using the wizard, you can drag and drop fields from the Data panel of the main window to add column/row headers and aggregations in a crosstab.

To add a column/row header in a crosstab:

  1. From the resource tree in the Data panel, select a group objects Group icon or dynamic formulas used as Group Dynamic Formula as Group icon if the crosstab is business view based, or a DBField or formula if query based.
  2. Drag the selected field to an existing column/row header until a blue line appears (for a blank crosstab, drag to the Total label to create the first column or row header), then release the mouse button. A new column/row header is then added above/on the left of the column/row.

After you have added a column/row header using the drag method, when you open the crosstab wizard, in the Display screen you can find the new fields in the corresponding box.

To add an aggregation in a crosstab:

You can add detail aggregations, subtotals and grand totals in a crosstab by dragging an aggregate field to the crosstab. The following fields can be used as aggregate fields in crosstabs: aggregation objects Aggregation cion, detail objects Detail icon, dynamic formulas used as Aggregation Dynamic Formula as Aggregation icon, dynamic formulas used as Detail Dynamic Formula as Detail icon and dynamic aggregations Aggregation cion in a business view; DBFields, formulas and crosstab formulas in a query resource.

  1. From the resource tree in the Data panel, select a field that can be used as crosstab aggregate field.
  2. Drag the selected field to the aggregation area in the crosstab until a blue line appears, then release the mouse button. The position determines whether detail aggregations, subtotals or grand totals will be created in the crosstab.

    The Insert Aggregation dialog appears.

    Insert Aggregation

  3. From the Aggregate Function drop-down list, specify the function used for the selected field.

    If the selected field has been predefined with an aggregate function, you cannot edit the function any more, and the drop-down list is changed to the Aggregation text box with the name of the field displayed in it.

  4. In the Label text box, specify the label text for the aggregate field if needed, which will label the newly created aggregations in the crosstab. If the crosstab is created using a business view, you can use the Auto Map Field Name checkbox to specify whether to automatically map the label text to the dynamic display name of the field at runtime. However whether the label would be displayed depends on if you have added any labels to label the column headers/row headers/aggregations in the crosstab while creating or editing the crosstab with the crosstab wizard. If no label is defined in the wizard, the label you add in the Insert Aggregation dialog will be ignored.
  5. Click OK and a new aggregation is added in the crosstab.

After you have added an aggregation using the drag method, when you open the crosstab wizard, in the Display screen you can find the new fields in the corresponding box.

For the aggregations in a crosstab:

Defining comparison functions in a crosstab

A comparison function refers to calculations of percentage, permillage, or difference between:

To define comparison functions in a crosstab:

  1. When creating or editing a crosstab with the crosstab wizard, select an aggregate field in the Summaries box of the Display screen and click the Comparison Function button. The Comparison Function dialog appears.

    Comparison Function

  2. From the Function drop-down list, select the required function: Percentage, Permillage or Difference.
  3. Specify a position for the comparison function.
  4. Numbers that form the calculation of the comparison function are determined by the Break By and Refer To drop-down lists.

    Items in the Break By drop-down list vary based on the position of the comparison function. It specifies the first parameter of the comparison function: the detail aggregation in the crosstab (Aggregate) or the subtotal of a specified row/column group.

    Items in the Refer To drop-down list also vary according to what you have selected from the Break By drop-down list. It specifies the other parameter of the comparison function: the grand total or subtotal for an outer row/column group.

  5. Click OK and you can see that a new field is added into the Summaries box. Set the display name for the field in the Label column if required.
  6. Repeat the above steps to define comparison functions for other aggregate fields in the crosstab.
  7. Click Finish in the Crosstab Wizard to apply the settings.

The following presents an example of using comparison function in a crosstab. It assumes that you have a web report with a crosstab in it in the catalog SampleReports.cat saved in <install_root>\Demo\Reports\SampleReports. The crosstab contains the following information:

The crosstab shows information about product sales volume in each state of Canada and France like below:

Initial Crosstab

Now, you want to define a comparison function in the crosstab to show the percentage of each state's sales volume to the grand total.

  1. Right-click the crosstab and click Crosstab Wizard on the shortcut menu.
  2. In the Display screen of the Crosstab Wizard, select Quantity in the Summaries box, then click the Comparison Function button.
  3. In the Comparison Function dialog, select Percentage from the Function drop-down list, check Comparison Function Spans on Row Direction, specify Product Type as the break by field and choose Grand Total from the Refer to list.
  4. Click OK in the Comparison Function dialog to return to the Crosstab Wizard.
  5. Click Finish in the wizard to accept the settings.
  6. In the Report Inspector, modify the value of the Format property of the fields corresponding to the percentage to #,###.##% (the fields are represented as QUANTITY9, QUANTITY10 and QUANTITY11 respectively in the Report Inspector).
  7. Preview the crosstab again and you will find that a percentage is added to the right of each state's sales volume.

    Crosstab Result with Comparison Function

Customizing the layout of a crosstab

When you create or edit a crosstab, you can use the Layout screen of the crosstab wizard to customize the layout of the crosstab according to specific data displayed in the crosstab so as to make the data more intuitive and readable. You can also customize the layout of a crosstab by setting properties in the Report Inspector.

Crosstab Wizard - Layout

The following are properties that are provided in the Layout screen.

Aggregate

Specifies properties of the aggregate fields.

Suppress Row Grand Totals

Specifies whether or not to show the grand total row in the crosstab. If the crosstab is a compound crosstab, you can click Choose button to customize the grand totals of which column compound groups will be suppressed and which will be shown in the Suppress Row Grand Totals dialog

Suppress Column Grand Totals

Specifies whether or not to show the grand total column in the crosstab. If the crosstab is a compound crosstab, you can click Choose button to customize the grand totals of which row compound groups will be suppressed and which will be shown in the Suppress Column Grand Totals dialog.

Suppress Row Subtotal

Specifies whether or not to show the subtotals of the row fields in the crosstab. You can click Choose button to customize which subtotals of the row fields will be suppressed and which will be shown in the Suppress Row Subtotal dialog.

Suppress Column Subtotal

Specifies whether or not to show the subtotals of the column fields in the crosstab. You can click Choose button to customize which subtotals of the column fields will be suppressed and which will be shown in the Suppress Column Subtotal dialog.

Repeat Column Header

Specifies whether or not the column headers appear on every page when the crosstab spans more than one page.

Use Table Style

Specifies whether to add labels to the Total rows and columns. If checked, you may find the row and column labels will be repeated too much.

Column Totals On

Specifies the position of subtotal and grand total columns on the left or right of the detail aggregations.

Row Totals On

Specifies the position of subtotal and grand total rows on the top or bottom of the detail aggregations.

BackPrevious Page Next PageNext