Specifying more than one row or column

Typically you specify one database column as the Columns definition and one database column for the Rows definition, as in the printer crosstab. But you can specify as many columns (or expressions) as you want.

For example, consider a crosstab that has the same specification as the crosstab in “Viewing the crosstab”, except that two database columns, quarter and rep, have been dragged to the Columns box.

PowerBuilder displays this in the Design view:

In the Design view, Header 1 is defined as Sum of Units, Quarter, and Rep. Next is Header 2, shown as blank, @ quarter, and @ quarter Sum of Units. Header 3 includes Product, @ rep, a blank, and Grand Total. Next is the Detail band, which includes product, units, and crosstabsum ( one, two, " @ quar, and cross tab sum ( one ). Next is Summary, shown as " Grand Total " and the expression sum ( units, sum ( sum _ units for all ), and sum ( grand _ sum _ units for. Some of the displayed expressions are truncated in the sample, but the  Design view allows you to scroll to see the full expressions.

This is what you see at runtime:

Shown is an example of the cross tab defined in the previous illustration.

For each quarter, the crosstab shows sales of each printer by each sales representative.