Crosstab Reports

Crosstab reports provide an easy way to relate two or more data attributes in a simple table format. The output is displayed as a table within a PDF document.

Sales chart showing product sales by region and sales rep within each region.

The Crosstab Editor allows you to specify which fields from the report query should be displayed as the rows and columns, and which field represents the numerical data to display in the table cells. You can also apply basic formatting to the report, such as headers and footers, colors, font styles, and text.

Creating a Crosstab Report

To create a new crosstab report:

  1. Ensure the DataBlock contains a report query that returns the desired information from your database.
  2. Select the DataBlock and then click the New button under Report Writer Actions.
  3. Give the report a name and description.
  4. Select Crosstab report as the report type.
  5. Click the Create button to open the Edit Report dialog.
    Create a New Report dialog showing Crosstab as one of the available report types.
  6. Click the Design button to open the Crosstab Report Editor.

Designing the Report

The Crosstab Report Editor is where you design the layout of your report.

Crosstab Editor showing a blank page, surrounded by various toolbars and information panes

The Object toolbar on the left side of the editor contains three types of objects that you can add to the report:

You can use the various alignment tools to arrange text and crosstab objects in relation to each other, their parent bands, or to the page.

Crosstab Editor

After adding a crosstab object to the report, the Crosstab Editor dialog is where you set up the crosstab report table.

Crosstab Editor showing a list of available data fields next to a visual layout where you can drag and drop fields into the lists of rows, list of columns, or list of numerical fields.  Underneath is a preview showing how the report will look, and a list of various configurable options.

The Source data pane contains a list of all of the available fields from the report query. To design the crosstab table, drag and drop these fields into the Crosstab structure area. Fields in the bottom left box will become the table rows, and fields in the upper right box will become the table columns. The lower right box should contain the field that represents the numerical data that you wish to view. In the example above, we are looking at sales totals, with the product names as the rows and the regions and sales rep names as the columns.

After configuring the crosstab data, select OK to insert the crosstab object into the report.

Crosstab object selected on the page underneath a title band.

Report Formatting

Notice the structure pane in the upper left now includes an object called DBCross1, which is the crosstab object we just added. Clicking on the object name will select it so that you can move or format it. Double-clicking on the object name or on the crosstab object will open the Crosstab Editor again so you can change settings.

To make the crosstab table easier to read, you may want to rename the column headers so that they are formatted differently or use friendlier names. Double click on any of the row or column headers to edit the text in that cell.

Renaming the "region_name, last_name" column header to something better that isn't just the data field names

You can change the font for the crosstab object or for individual headers or table cells using the Font toolbar at the top of the screen.

For this report, we want to make the headers bold and larger than the other text. For each header cell we want to change, we will first select the cell. Then, we will make it bold and increase the font size to 12.

Changing the Font > Style > fsBold property to True

The Background and Border toolbar allows you to change the lines and colors used in the report.

For example, you may want to darken the header cells so that they stand out better from the rest of the report.

Formatting and other properties can also be changed via the Properties pane in the lower left, which includes more advanced options than can be configured using the toolbars. A full list of object properties and toolbar options is available in the Argos help.

Report Preview

When you are finished configuring the report, you can use the Preview button on the first toolbar at the top of the screen to see how the report will look when run.

Preview window showing 2 pages of output, populated with data from the report query.