Link to home
Start Free TrialLog in
Avatar of meagain0707
meagain0707

asked on

Limit the number of detail lines printed for a group in crystal

I'm creating a push report which has a department group.  Within each group I only want to print a maximum 20 detail lines. How do I do this?
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

What happens after 20 - do you want to ignore the rest?
Avatar of meagain0707
meagain0707

ASKER

Yes, ignore the rest for that group and print the next group with a maximum of 20 lines.
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The summaries should not include the data that may be missing, only up to the 20 lines. Also, Im using product version 11.0.0.895.
You could try using a TOP 20 selection.

mlmcc
Thanks for you answers mlmcc.

I tried the Top 20 and it doesn't work for me because top 20 needs a summary for the group. Then it will rank the totals of the summary to print the top or the bottom N. This means that departments won't print, it's the detail lines that I don't want to print  for up to a maximun of 20 lines. I will keep this in mind if I ever need to build a report with those requirements.

I looked at your other solution with the formulas. I don't understand where to enter them. I don't know where the suppression formula is in the detail section. I don't know how to add a formula specific to the group header. Please help with some more details. I did try..... I think, for the group header, I just add the formula and suppress the printing?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi James,

You had excellent instructions for me to follow, thanks so much! I was able to limit the lines and do the group totals, I also had to add some grand totals. I learned a lot about crystal.

I didn't totally understand report I was developing until now. Not only do I need the limited lines(up to 20), but I also need a percentage calculation for each of those lines which uses the total for the group. (line amount /sum of the group ).  I don't have the 'sum' until the all the lines of the group are printed so I don'think this is possible. Is it?

I'm going to try to limit the result set sent to crystal instead.
 > I don't have the 'sum' until the all the lines of the group
 > are printed so I don'think this is possible. Is it?

 Off hand, I'm going to say no.  To have CR give you a group total in the details, you have to use a CR summary function, and I don't think you're going to be able to use one when you're limiting the number of records like that.

 You could put a subreport in the group header and have the subreport read the first 20 records for that group and save totals in variables, and then use those variables in the details in the main report to calculate your %'s.  It would be very inefficient, especially because, like the main report, it would be reading all of the records for the group, but only including the first 20 in the totals.  But it could theoretically be done.

 It would be much better if you can limit the data sent to CR instead, as you suggested.

 James
Hi James,

I did limit the data sent to CR.

Many thanks!
You're welcome.

 James