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

Page Breaks - No grouping 1

Status
Not open for further replies.

DerbyNeal

Programmer
May 12, 2005
22
0
0
GB
Using Crystal 10.

Hi,

In a report I need a page break on every 23rd record. There are no Groupings in this report and I have tried the following code in the Section Expert (New Page After):

Code:
not (onfirstrecord) and (RecordNumber MOD 23) = 0

However, due to other formulas, the Record Number is not always shown as 1,2,3, etc and so although the displayed results are grouped in 23's there isn't necessarily always 23 records on each page.

Any ideas please?

Thanks in advance,

Neal
 
If recordnumber is not working try using a variable.

In details add formula

@pagebreak
whileprintingrecords;

global numbervar page:=page+1

In section expert page break formula

whileprintingrecords;
global numbervar page;
not onfirstrecord and
remainder( page, 23) <> 0

Ian
 
Hi Ian,

I've created the 1st part and dropped it in the report 'Details' section and then added the 2nd part in the 'New Page After' Section Expert but it still restricts the output. Also, the 1st page is now blank.

I do appreciate your help though.

Neal
 
Neal

Are you conditionlly suppressing details?

Make the page break formula visible and ensure it is incrementing as expected. If not change the formula to increment by 1 under the same conditions. In your first post you said

However, due to other formulas, the Record Number is not always shown as 1,2,3, etc

ie replicate what these formula are doing to record count.


Oops - sorry when page = 0 it will force a page break.

Change page braek formula

whileprintingrecords;
global numbervar page;
not onfirstrecord and
remainder( page, 23) <> 0 and
page <> 0

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top