Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit the number of cross-tab columns?

Status
Not open for further replies.

forylma

Programmer
Nov 14, 2001
6
AU
Hi All,

Is there any way we could limit the number of cross-tab columns? Say, we wanna limit the number of columns to 5. Because I am trying to avoid the virtual page created by Crystal Report when I am using cross-tab.

Cheers,

Fory
 
Fory,

Unfortunately when you use the Crystal cross-tab expert you get a lot of functionality, but you have to play by their rules. You cannot limit the number of columns unless you actually limit the data using a selection method, which I am sure you did not have in mind.

Check out my FAQ,
faq149-1219
on this site for a step by step approach to creating a "manual" cross-tab. It is more work but you will have complete control.
Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
The problem with a manual cross-tab is that you have to decide which five values to show, in other words the columns aren't the first 5, but are a hard coded group of 5.

If you DO know the 5 values you want to display, I still wouldn't use a manual cross-tab in this case. You can use the "specified order" feature of the cross-tab to specify the 5 column values that you want, and tell it to discard others. Manual cross-tabs are great in certain cases, described in faq149-243, but make for extra work in this case.

Unfortunately, if you want to display the 'first' 5 columns, and have it be dynamic, I don't know a way to do this. You can use TopN for dynamic rows, but not for dynamic columns. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
1. Create a formula:

@limited_columns

whilereadingrecords;
if {customer ID} in 1 to 10 then 1
else
if {customer ID} in 11 to 20 then 2
else
if {customer ID} in 21 to 30 then 3
else
if {customer ID} in 31 to 40 then 4
else
if {customer ID} in 41 to 50 then 5

2.. Create a group based on this formula:

· Go to Insert | Group

· Select {@limited_columns} as the field to group on.

3. Place the cross-tab in the group header or footer. The cross-tab displays only the data related to that group.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top