Crystal Reports for Rational Application Developer Designer Guide
To create a cross-tab report
The following example uses tables from
the Xtreme sample database. The cross-tab will show the quantity of gloves and
helmets sold for the following countries:
China
England
France
Japan
USA
Create a blank report. and
drag the following tables to the
"Field
Explorer" view:
CUSTOMER,
ORDERS,
ORDERS_DETAILS, and
PRODUCT.
Click the
Data tab of the report editor view, and link the tables on
common fields.
For example, both the Customer and
the Orders tables have a field called "Customer ID", so you could link the
tables on that field.
Click the
Formulas tab and type the following in the Record Filter:
({CUSTOMER.COUNTRY} = "China" or
{CUSTOMER.COUNTRY} = "England" or
{CUSTOMER.COUNTRY} = "France" or
{CUSTOMER.COUNTRY} = "Japan" or
{CUSTOMER.COUNTRY} = "USA") and
({PRODUCT.PRODUCT_TYPE_ID} = 5 or
{PRODUCT.PRODUCT_TYPE_ID} = 6)
Click the
"Layout"
tab.
Select
Cross-tab from the palette and place the object in the
Report Header or the Report Footer section.
In the
"Field
Explorer", select the
COUNTRY field from the CUSTOMER table, drag it to the
upper-right-hand corner of the Cross-Tab object, and click to release it.
You will see a placement arrow to
show you where the field will appear when you drop it. You can place the field
to the right or the left of the column Total value.
In the
"Field
Explorer", select the
PRODUCT_NAME field from the PRODUCT table, drag it to the
lower-left-hand corner of the Cross-Tab object, and click to release it.
You can place the field either above
or below the row Total.
In the
"Field
Explorer", select the
QUANTITY field from the ORDERS_DETAILS table, drag it to
the group of boxes that represent the intersection of the rows and columns, and
then click to release it.