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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit Columns in Crosstab to 25 per Page

Status
Not open for further replies.

tubbers

Technical User
Jun 23, 2004
198
US
I'm using Crystal XI with SQL MDB and no ability to create views or stored procedures. I've not had much experience with Crystal Reports and/or crosstabs.

I've had a look at other posts regarding similar issues but so far none of the techniques have worked as they do not seem to address multiple fields in the row portion. Is this possible?

I have a report which consists of a crosstab in the report header only. All other areas have been suppressed. The crosstab's colum is {table.user} and the rows are grouped first by {table.drug} and then by {table.event}. The summary is the count of events by drug for each user.

Code:
                 User 1  User 2  User 3  User 4  etc.
Drug 1  Event 1    1       0       1       5
        Event 2    1       2       1       4
Drug 2  Event 1    4       6       7       9
Drug 3  Event 2    1       7       5       6

etc.

The number of users varies depending on the unit parameter but in the larger units, there can be up to a 100 users. There are also a large number of drugs.

What I want to do is limit each page to 25 users and have the crosstab cycle through all the drugs before printing the next group of 25 users. I do not need row or column grand totals.

 

This is the posts I had reviewed and attempted to apply to my situation (Solution 2 in the last post).

Code:
[b]@grp[/b]
number var col;
stringvar x;

if instr(x, {table.user}) = 0 then
(x := x + {table.user};
col := = col + 1);
if col in 1 to 25 then 1 else
if col in 26 to 50 then 2 else
if col in 51 to 75 then 3 else
if col in 76 to 100 then 4 else
if col > 100 then 5
 
Are you sure that using virtual pages will not meet your needs? You can format the crosstab to repeat row labels on virtual pages, and then you have in essence what you want.

-LB
 
Is there any way to get page numbers to print on the virtual pages?

I have to export this report to a .pdf file and send it to someone else and it usually ranges up to 50 pages once you print it out with all the virtual pages and they find it difficult to put it all together. I don't mind using the virtual pages if there is a way to get it formatted for clarity.

I use this formula to get a "title" to print on every virtual page (from Ken Hamady):
Code:
[b]@Display Report Title[/b]
WhileReadingRecords;
{@Display Month Name} + chr(13) +
"AcuDose Events Summary by Drug for " + {?Unit}
 
In the field explorer, go to "special fields" and you will find a field called "horizontal page number"--this will number the virtual pages consecutively. If you add the actual pagenumber field also and then right click->format field->common->check "repeat on horizontal pages", you will have the vertical page number as well to use in conjunction with the horizontal page number. I would place the crosstab in the report footer, and use the page header for the two pagenumber fields. This should make assembly simple.

-LB
 
Thanks, that worked out very well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top