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

Multiples of 4 pages

Status
Not open for further replies.

dswitzer

Technical User
Aug 2, 2002
298
US
I am trying (CRXI) to force reports to print out with a multiple of 4 pages. So, if the report is 10 pages long add 2 blank pages 2+10=12. If the report is 17 pages long - add 3 blank pages 3+17=20. If the report is 12 pages long -- no need to add pages. and so on.

So, the way I see it -- I need 3 blank pages on the report with conditional suppression.

Any ideas on what I should use as suppression criteria on each of the three pages?
 
Split report footer into 4 sections make the 3 lower sections one page big.

In first report footer, place formula

whileprintingrecords;

global numbervar overpage:=0;
global numbervar pcount:=0;

if Remainder(pagenumber, 4) <> 0 then
pcount:=int(pagenumber/4);

pcount:= pcount+1;

if Remainder(pagenumber, 4) <> 0 then
overpage:= (pcount*4) - pagenumber;

This will return values from 1 to 3

Use these in conditional formatting to suppress extra pages
eg on last report footer use

whileprintingrecords;

global numbervar overpage<2

etc

Ian
 
Thanks Ian - I think I'm close now.

I did the extra pages in group footers -- which I don't think matters.

The issue now is that in the first group footer -- I added the code you so graciously wrote, and added "overpage;" to the bottom so I can see the value -- looks good:
Code:
whileprintingrecords;

global numbervar overpage:=0;
global numbervar pcount:=0;

if Remainder(pagenumber, 4) <> 0 then
pcount:=int(pagenumber/4)
else pcount:=0;

pcount:= pcount+1;

if Remainder(pagenumber, 4) <> 0 then
overpage:= (pcount*4) - pagenumber+1
else overpage:=1 ;
overpage;


However, the following 3 sections are not hitting the suppression code...so I made a new variable:
Code:
global numbervar overpage;
overpage;

I then added this variable in the blank pages in an attempt to see if the global variable was being passed and I must be missing something because it is showing up as zero in each instance.

My suppression code looks like this:
Code:
Whileprintingrecords; 
Shared BooleanVar Suppress; 
If global numbervar overpage>0 then Suppress:= FALSE
Else Suppress:= TRUE

I hate to admit this -- but I have spent all day on this stupid thing -- do you see anything wrong?

Thanks.

Dave
 
If your total page number is divisible by 4 then overpage will always be 0.

The suppression formula assumes you will be delivering a boolean.

Thus for first page

whileprintingrecords;

global numbervar overpage<1 // suppress if overpage = 0

The result of this is either true or false if true page will be suppressed.

Second page

whileprintingrecords;

global numbervar overpage <2
// suppress if overpage = 1 or 0


Third Page

whileprintingrecords;

global numbervar overpage <3
// suppress if overpage = 2, 1 or 0

Ian


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top