Creating a crosstab report

Assume that you have already opened a report set, to create a crosstab report within it:

  1. Do either of the following to open the New Report dialog.
  2. In the dialog, specify the title of the report, select the Crosstab Report layout and click OK. The Crosstab Report Wizard will then be displayed.
  3. In the Data screen of the wizard, specify the dataset on which the crosstab will be built.

    Notes:

    • After choosing the dataset, you can click Finish directly in the report wizard to create a report with a blank crosstab in it. After which, you can drag the required data fields, which are contained in the created/specified dataset, from the Resource View panel to the report.
    • If you want to create the crosstab on an HDS, pay attention to the unique features of HDS. For details, refer to Developing reports from HDS.
  4. In the Display screen, add the required fields from the Resources box to the Columns and Rows boxes respectively to make them displayed on the columns and rows of the crosstab.

    For the added fields, you can specify their display names in the Label column, the background color in the Color column, set the sorting manner of the field values by clicking , and adjust the display order of the fields by clicking or if required.

  5. Add the specific fields to the Summaries box as aggregate fields, and specify the aggregate functions for the added fields as required. If necessary, click the Comparison Function button to set the comparison function.
  6. To apply some filters to the crosstab so as to reduce data displayed in the crosstab, go to the Filter screen and define the filter conditions as required.

    To define a filter condition, click the Add Condition button to add a condition line, then from the field drop-down list, select the field on which the filter will be based, set the operator with which to compose the filter expression from the operator drop-down list, and in the value combo box, type the value of how to filter the field or select the value from the drop-down list.

  7. In the Layout screen, specify the layout of the crosstab according to your requirements.
  8. In the Style screen, specify the style of the crosstab, and if required, click the Page Setup button to set the page settings.
  9. When done, click Finish to create the report.

See also:

See an example: The SampleComponents catalog, included with JReport Designer, contains reports that have examples of report layout types. For the crosstab report layout example, open <install_root>\Demo\Reports\SampleComponents\Crosstab.cls.