Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

Cross-tab overview

A cross-tab is an object that summarizes data and then presents the summaries in a compact row and column format that makes it easy to make comparisons and identify trends.

Report examples are provided to demonstrate the power of a cross-tab in those situations in which the cross-tab is an option. Those are often situations in which the word by is included in your report description:

sales by state,

products sold by color and size, or

orders by customer.

While there are certainly many ways to create these kinds of reports, cross-tabs generally present more data in a more compact, easier to understand form than other reporting methods.

NOTE: You can insert as many cross-tab objects in your report as you need. You can even place them in subreports. Thus, you can use cross-tabs to show summarized data in a report that presents the details in another form.

In the following examples, the goal is to analyze the unit sales of five different bicycle locks in four different regions (a unit sales of locks by region report). For clarity, only the most essential information in these reports has been included:

the region the order came from,

the name of the lock, and

the quantity ordered.

The first way of looking at the data is in the most basic of all reports, a columnar report with no grouping or sorting.

446

Seagate Crystal Reports User’s Guide

Report of order data - no sorting/ grouping

Report of

order data - grouped by region

This report presents nothing but details. Each row represents an individual order. There are many orders from each of the regions for different locks. But because there is no summary information, it is nearly impossible to get any useful information out of a report like this.

The next logical step is to group the data in some way. You can group it by region, or by product line. You will take a look at both of these options.

This report uses the data seen in the first report, but here the data is grouped by Region. All the orders for each Region are grouped together, but each regional group contains orders for different kinds of locks. Because the groups contain different kinds of data, summarizing the Quantity field will determine the total number of locks sold per Region, but not the total of each kind.

Cross-Tab Objects

447

Each Region group contains orders for different kinds of locks.

Report of

order data - grouped by product

This report groups the data by product. Each group displays all the orders for a specific product. At first it appears that this might be useful, but then it becomes clear that each product group includes orders from several different regions. The information is helpful, and it brings you closer to your goal, but you are still a long way from having the information you need.

Each product group contains orders for many regions.

448

Seagate Crystal Reports User’s Guide

Report of

order data - grouped by region and product

This report is the logical next step. If the By Region report contains multiple products in each region group, and the By Product report contains multiple regions in each product group, then it seems to make sense to combine the two. Doing that, you group first by Region and then by Product.

Each group contains orders for one product for one region.

Order data in a cross-tab object

But the data is all spread out and remains difficult to analyze. The information is useful, and with a little work you can use a report like this to get the comparison information you need. But a crosstab offers a better solution.

Using a cross-tab, all the information you need is provided in a compact format. The report shows what products were sold in which regions and what the unit sales were. It is easy to see, for example, that Guardian Mini Locks are not popular at all in California but they are the biggest seller in BC or that Florida is being outsold by Alabama in every lock category.

Cross-Tab Objects

449

Regions.

Product names.

Total - one product in one region.

Total - all products

Total - one product

Total - all products

in one region.

in all regions.

in all regions.

In this cross-tab:

Product names make up the row headings.

Regions make up the column headings.

The value at each row/column intersection is the sum of all the orders for a particular product from a particular region, for example, the total number of Guardian Mini Locks ordered in British Columbia.

The total at the end of each row is the total of all of the purchases for one product in all regions, for example, the total number of Guardian ATB Locks ordered in Alabama, British Columbia, California, and Florida combined.

The total at the bottom of each column is the total number of all kinds of locks ordered in one region, for example, the number of locks of all kinds purchased in California.

The total in the bottom right corner is the grand total showing the total unit sales of all five locks in all four regions.

The report is compact, and you can compare your customers' purchasing habits in a hurry. Clearly this is a worthwhile report in situations such as this.

450

Seagate Crystal Reports User’s Guide

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]