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

Crystal 9 - Limit records in detail section

Status
Not open for further replies.

Slimsteve

Technical User
Jun 10, 2003
67
GB

HI,

Does anyone know if it possible to limit the number of records displayed in the details section of a report before a new page is created, if so how????

Slim
 
You might address this by using the New Page After Formula (right click the details section and select format section->X 2 next to New Page After) and add:

recordnumber/20 = int(recordnumber/20)

This would create a new page after every 20 rows, so alter the 20 to however many rows you want.

-k
 

Thanks that works.

But there is one more issue with my report, because I am grouping my records in the details section by "DOCNO", I really would like to get a count of group headers ("count(docno)"), then divide recordcount by that and then by 20.

Is this possible??

Slim
 
Sure, but it seems ill advised.

If you have a total of 3 groups, and 60 total records, your formula would say (60/3)/20 which equals 3...

And since records can't be grouped in the details section, I'm at a loss for the real intent.

Perhaps you can supply some example data and expected output.

-k
 

Bascially I am trying to create some new Invoice Templates for a mail order system.

The top 1/3 of the page shows the account details i.e. document number, Name, address, etc.

The middle section of the page shows the invoice details, list of product codes, with prices.

The bottom section of the page shows the documents totals etc, when the details section is completed.

The only grouping that I am doing on the report is by Document number, so as to keep all the related records together. The formula you first gave me works fine if I am just creating one document, but if I enter a number range of documents (with various numbers of products), when the same group breaks on to more than one page, it does not work.

For example, I have one document which has 30 records, when using the formula you gave me and a single document number it displays 20 records on the first page and 10 records on the second page.

But, if I use the same formula when entering multiple document numbers, the same document has 14 records on the first page and 16 records on the second page.

Bascially I need to try to calculate the number of records for each group change and then use that figure to format the report.

Hope that makes sense.

Slim
 
Hi,
It may ( I emphasise may ) be easier to do that with subreports...since each subreport can have its own formating, it may be possible.

( Sorry for the abiguity, but, since I haven't seen your data, nor tried this technnique, I can only be theoretical)
[profile]
 
I don't know if this helps, but I've done something similar (an invoice with 6 details per page). I used the following new page after formula:

remainder(recordnumber, 6) = 0
 
If you want a count within each group so that the page break always occurs after 20 records for a group then create a running total {#cntwingrp} using the running total editor:

select a recurring field like {table.ID}, count, evaluate for each record, reset on change of group (Doc).

Then go to format section->details->new page after and enter:

remainder({#cntwingrp},20) = 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top