cancel
Showing results for 
Search instead for 
Did you mean: 

How to use TotalPageCount

Former Member
0 Kudos

Post Author: drs

CA Forum: General

Hi,

I'm trying to use TotalPageCount in GroupHeader 's "New Page after" to determine if the total page count is even or odd.Based on that the report should generate blank page at the end.Here is the code:

TotalPageCount mod 2 =1

Can someone help

thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Post Author: drs

CA Forum: General

Thank you very much for replying as it is very urgent.

1.I tried this code in Group Footer and unchecked the "Keep Together" for data which the report generates 3 pages.

I can see even total number of pages means it shows 3 of 4 but i can not navigate to last blank page when the data actually ends by odd page count.

And i exported this to PDF ,it generates only 3 pages.

2.I tried this code in Group Footer and unchecked the "Keep Together" and also conditionally suppressed report footer (this report subreport ,there is no page footer)with the statement:

OnLastRecord;

It's not generating even pages when it is odd.

Thanks

Former Member
0 Kudos

Post Author: drs

CA Forum: General

Thank you very much for replying as it is very urgent.

1.I tried this code in Group Footer and unchecked the "Keep Together".

I can see even total number of pages but i can not navigate to last blank page when the data actually ends by odd page count.

2.I tried this code in Group Footer and unchecked the "Keep Together" and also conditionally suppressed report footer (this report subreport ,there is no page footer)with the statement:

OnLastRecord;

It's not generating even pages when it is odd.

Former Member
0 Kudos

Post Author: SKodidine

CA Forum: General

Try this:

In the group FOOTER, right click on it and then click on Section Expert. Under the Common tab, click on X-2 next to 'New Page After'. In the formula workshop window type:

onlastrecord and remainder(totalpagecount,2) <> 0;

Based on your previous post, this will insert a blank page if it is the last record and the totalpagecount is an odd number.

P.S.: You might have to uncheck 'Keep Together' for the group footer and also conditionally suppress the page footer and report footer with the statement:

OnLastRecord;