cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Crosstab documentation

Former Member
0 Kudos

Hello gang,

Quick questions about custom crosstabs. I remember reading an article or kbase about pros and cons of cross tabs but I can't find it under "custom", "mock" or "simulated". Can anyone point me in the right direction? The problem I'm specifically trying to address is that I have about 25 columns of data that don't fit on one page and I need to spread them across multiple pages.

Thx!

- Pedro

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you for the information. However, what I need to accomplish is to imitate what the real cross tab does with the columns. I need to be able to add columns past the margin into virtual pages. I have a report that has about 35 columns that need to be displayed in 4 columns per page. Is there a way to do this by adding a real crosstab or imitate it as well?

Thx!

- Pedro

Former Member
0 Kudos

Below are the contains of the article-- 1212953 "How to create a custom cross-tab with percentage values"

This article applies to Crystal Report 9 and above versions.

Symptom

You create a report in the Crystal Reports designer and want to insert a cross-tab that displays percentages. Upon creating the cross-tab, you notice there is no option to display percentages.

How can you create a cross-tab that displays percentages?

====================

NOTE:

In Crystal Reports 9, there is a Cross-Tab option to display a summary as a percentage of the grand total. In the Cross-Tab Expert, click the 'Change Summary' button. In the 'Edit Summary' dialog box, under 'Options', check the 'Show as a percentage of' check box.

For more information, refer to the Crystal Reports Online Help by pressing the 'F1' key.

====================

Resolution:

You cannot create a cross-tab that displays percentages. However, you can achieve the same effect by creating what is called a custom cross-tab. A custom cross-tab is a regular report that is built and formatted to look like a cross-tab. Custom cross-tabs are handy because they allow more report design flexibility than cross-tab reports do.

In the following procedure, the custom cross-tab returns percentage values of different companies' sales as a percentage of the total sales for the USA and Canada.

To create a custom cross-tab that displays percentage values, follow these steps.

1. Create a blank report in the Crystal Reports designer. Do not use the 'Report Expert'.

2. Determine how many columns your report requires and insert that number of text objects into the Page Header. These text objects will act as column headings.

For example, the text objects could read "USA" and "Canada".

3. Create a group on the field that you want to display as the rows of the report.

In this example, this field is the customer name field.

4. Suppress the Details Section and the Group Footer Section of the report.

You now have the basic structure of your custom cross-tab with column and row

headings. However, there is no meaningful data on the report yet.

To create the percentages for this example, follow these steps.

1. Each column on the report requires a separate formula to display its corresponding row

data.

Start by creating a formula called @column.

//@column

//returns last year's sales for Canada.

If {Customer.Country} = "Canada" then {Customer.Last Year's Sales}

2. Place @column in the Details section directly below the text object heading

'Canada'.

3. Repeat steps 1 and 2 for each column heading. Change the formula name and syntax

to reflect the correct country.

4. Right-click @column to select it.

5. From the fly out menu, select 'Insert' and then select 'Summary'.

6. On the 'Insert Summary' dialog box, select 'show as a percentage of'. Leave all other values set to their default.

7. Click 'OK' and a percentage summary field is automatically placed in the Group

Footer. Move this summary field to the Group Header, directly beneath the

heading for Canada. Repeat steps 8-11 for each column heading.

Because the data in the columns is static, you must limit the report data to the columns you have specified with a record selection formula.

//only returns records for USA and Canada.Put USA and Canada in Square backet.

{Customer.Country} in ["USA", "Canada"]

When you preview the report, it is structured with rows and columns like a cross-tab and displays percentages. However, there are no lines or borders around the fields therefore the report does not look like a cross-tab.

To add borders around the fields on your report, use the 'box' and 'line' options from the 'Insert' menu. This way, you can add lines and boxes to your report and make it look like a cross-tab object.

Now when you preview the report, it looks like a cross-tab and displays percentages.

Regards,

Alpana