(Crystal Reports) Break page after certain # of details?

Antrim picture Antrim · May 30, 2012 · Viewed 10.2k times · Source

I am trying to create a check writing report that will work in the following way:

  • The first section of each page of the report will include all line items that will be added into the check.
  • The middle section of each page of the report will be the actual check, with Payee, payer, amount, address, etc.
  • The last section of each page of the report will simply be a copy of the first section.

Each page of the report will include 10 line items AT MAX. For example, if we are writing a check that will account for 12 items, the report will have two pages:

  • The first page will have the first 10 line items (in both the first section and last section of the page) and a check with the amount of 0.00.
  • The second page will have the other 2 line items (in both sections) PLUS the actual data for the check. Basically, the only valid check will be the one on the last page of the report.

My idea is to have a DataSet with two tables, one for the line items and the other one for the check data. And in the check table, have one row per page. So in the previous example, I would have 12 rows in the line items table, and 2 rows in the checks table (one would have 0.00 as the amount, and the other one would have the actual X.XX amount). I was also thinking about grouping by check, and add a page break after each check, but I am not sure on how to make sure that only 10 line items are in each page.

Any help, or new ideas on how to approach this matter?

Thanks!

Answer

Asif picture Asif · May 30, 2012

To make it show 10 records per page do the following

  1. Open the report in Design View

  2. Right click on the Details section and select Section Expert

  3. Make sure the Details section is selected in the Section Expert dialog box. Check the box that says "New Page After"

  4. Click the formula editor button to the right of the checkbox.

  5. Enter the following formula

if Remainder (RecordNumber, 10) = 0 then true else false

6.Click Save and Close and then click OK.