|
Return to Newsletter Contents...
Working with Cross-Tab Reports
by: Thomas Hinkle, Consultant, CRCP
You’ve
created a summarized report and it displays the correct values but it may be
several pages long and difficult to read quickly.
Crystal Reports allows you to create a compact view by using Cross-Tabs.
The Cross-Tab object is a grid that displays values that are grouped and
summarized
in compact rows and columns.
Details of a Cross-Tab report
A Cross-Tab object is made up of three
elements:
-
Rows
-
Columns
-
Summary fields

-
The rows in a Cross-Tab run horizontally (from side to side). In the
example, “Gloves" is a row
-
The columns in a Cross-Tab run vertically (up and down). In the example
above, "USA" is a column
-
The summary fields are found at the intersection of rows and columns. The
value found at each intersection represents a summary (sum, count, and so
on) of those records that meet the row and the column criteria. In the
example above, the value at the intersection of "Gloves" and "USA" is four,
the number of gloves sold in the USA
A Cross-Tab also includes several totals:

At the
end of each row is a total for that row. In the example above, this total
represents a single product sold in all countries. At the end of the "Gloves"
row is the value 8, the total number of gloves sold in all countries.
Note: The total column can appear at the
beginning of each row.
-
At the bottom of each column is a total for that column. In the example
above, this total represents all products sold in a single country. The
value at the bottom of the "USA" column is four, the total number of
products (gloves, belts and shoes) sold in the USA
Note: The total column can appear at the top
of each column.
-
At the intersection of the Totals column (totals for the products) and the
Totals row (totals for the countries) is a grand total. In the example
above, the value at the intersection of the Total Column and Total Row is
12, the total number of all products sold in all countries
How to create a
Cross-Tab report
Things to keep in mind when using Cross-Tab objects:
-
You can drag report fields into or out of Cross-Tab objects
-
You can have multiple rows, columns, and summarized fields
-
You can use print-time formulas as your rows or columns
-
You can use Running Total fields as your summarized field
-
You can include a group sort (top or bottom N) on the rows in your Cross-Tab
Note: Group sorting cannot be applied to
columns.
-
You can insert as many Cross-Tab objects in a report as you need
-
You can insert the Cross-Tab into either the Report Header or Footer, or the
Group Header or Footer
-
You can place Cross-Tab objects in subreports. This is useful when you want
to refer to the results from another report
To create a Cross-Tab Report using the Cross-Tab Report Wizard
-
On the Start Page, click Cross-Tab Report Wizard
-
Select the data connection and linking
- Add
fields from the Available Fields area to the Rows, Columns, and Summary
Fields areas
-
The next screen allows you to create a chart or you
may add a chart later
-
Select any record selection you may want and then choose a grid style and
click finish
To add a Cross-Tab object to an existing report
-
Open your report
-
Click the Design tab
-
On the Insert menu, click Cross-Tab
Tip: Another way to do this is to click the
Insert Cross-Tab button on the Insert Tools toolbar.
An object frame appears with the Arrow cursor as you drag the Cross-Tab object
into the report.
-
Place the object frame in an empty area in the
Report or Group header or footer and click to release
it
An empty Cross-Tab object appears in your report. You can drag fields from your
report or from the Field Explorer into your Cross-Tab.
-
In the Field Explorer, select the
field that will be your column value and drag it to the Cross-Tab
-
Drag the field to the upper-right-hand corner of the Cross-Tab object
You'll see a placement arrow to show you where the field will appear when you
drop it.
Once you have clicked to release the field, it appears to the right of the
column that you selected.
-
In the Field Explorer,
select the field that will be your row value and drag it to the
Cross-Tab
-
Drag the field to the lower-left-hand corner of the Cross-Tab object, and
click to release it
-
Finally, drag the field or formula
that will be your summary to the
Insert Summary cells of the
Cross-Tab, and click to release it
Tip: Notice that all of the cells change
color when you position the field over them.
-
Click the Preview tab to see your Cross-Tab
To modify a Cross-Tab object right click and choose the
Cross-Tab Expert.
This will allow you to change field selection and customize the Cross-Tab
style.
There are
many options available and the Cross-Tab Expert will allow you to access those
options. Crystal Reports Help can
assist you with questions you may have about Cross-Tab reports.
Cross-Tab
reports are included as part of the Crystal Reports Design II, RD210R2, two day
class.
Go to Top |
Return to Newsletter Contents
|