Implementation of several cross tabulation in the crystal report (author atai)

Source: Internet
Author: User
Tags crosstab
Source: http://www.cnblogs.com/babyt/archive/2008/05/06/1184249.html


A crosstab chart, as its name implies, is used to present data on rows as column indicators.

The following figure shows the data style in Figure 1.

The final result is 2.

In actual use, we can achieve this effect in two ways

First, data is organized into a cross-tabulation using SQL on the database end, and then presented as a normal report.
Here, I have excerpted a straightforward article written on the Internet. Please refer to this link.
Http://server.chinabyte.com/474/2591974.shtml
Based on the data, the column after crossover may be fixed or not fixed.
Note the writing method, and note that the SQL statements of different databases are also different. For example, SQL Server and Oracle are different.
Here we will provide an idea.

Second, it relies on Crystal Reports for direct implementation. At the end of the article, I provided an operation video. You can refer to the actual operation steps.
It should be noted that not all data is so standard, so some correction is required.
Crystal Reports not only support retrieving data from tables, but also support View and SQL commands, stored procedures, etc.
Therefore, you can use View or SQL commands. In the video example, I used this example.
The raw data is like this (figure 3 ),


To apply the crosstab chart, modify it as shown in Figure 1.
I made a View to simplify subsequent operations. For subsequent operations, the effects of using tables and views are the same.
View Script:

Select Year, region, indicator, 'maxim' as value category, maximum value as value from test_4
UNION
Select Year, region, indicator, 'minimal' as value category, minimum value as value from test_4;

At the end of the video, I performed some operations on the cross tabulation settings. For details, refer. For example:
How to remove the total fields of rows and columns
How to remove the corners in the upper left corner of the crosstab chart and other basic operations

It is particularly difficult to export a perfect Excel file from a cross table.
If this is necessary, we recommend that you use the SQL crossover method and the general report method.

Download the operation video here. Unzip it with the password babyt.
/Files/babyt/CR20080505.rar
(This video is animated)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.