fkimonis
asked on
Duplex and Total Page Count issue
Crystal 10 - Oracle db.
I'm having trouble correcting the 'total page count' of a report. This is necessary because I am conditionally adding an extra page to assist with duplex printing.
The report will be used to generate customer statements. I am grouping by the statement code, the customer account number and the statement month number. If a statement ends on an odd page I am conditionally showing a group footer section of the month number - which is large enough to create the extra page needed for duplex printing.
The problem is I don't want to count this extra page in the page count total. How do I conditionally subtract 1 from the total page count of each statement whenever I show the extra page?
Thanks
Frixos
I'm having trouble correcting the 'total page count' of a report. This is necessary because I am conditionally adding an extra page to assist with duplex printing.
The report will be used to generate customer statements. I am grouping by the statement code, the customer account number and the statement month number. If a statement ends on an odd page I am conditionally showing a group footer section of the month number - which is large enough to create the extra page needed for duplex printing.
The problem is I don't want to count this extra page in the page count total. How do I conditionally subtract 1 from the total page count of each statement whenever I show the extra page?
Thanks
Frixos
ASKER
Hi frodoman,
That doesn't work because totalpagecount will always be even - having added the extra page to compensate for duplex printing.
BTW the total page count is shown in the page header of report.
Any other suggestions would be greatly appreciated.
Frixos
That doesn't work because totalpagecount will always be even - having added the extra page to compensate for duplex printing.
BTW the total page count is shown in the page header of report.
Any other suggestions would be greatly appreciated.
Frixos
Gotcha.
Unfortunately I don't think you're going to be able to do this. The problem is that your conditional suppression must take place during the WhilePrintingRecords phase which is also when any formula you create that uses TotalPageCount must also be evaluated. The page header is going to be rendered before the group footer is so you're stuck. I tried using a shared variable in the conditional suppression formula and tried forcing the page number formula in the page header to evaluate later but Crystal won't do it.
The only way I can think of to accomplish this is if you can find another way to handle the conditional suppression - something based on record count or the like that could be evaluated during the whilereadingrecords phase so there is time in the whileprintingrecords phase to do something with the information.
frodoman
Unfortunately I don't think you're going to be able to do this. The problem is that your conditional suppression must take place during the WhilePrintingRecords phase which is also when any formula you create that uses TotalPageCount must also be evaluated. The page header is going to be rendered before the group footer is so you're stuck. I tried using a shared variable in the conditional suppression formula and tried forcing the page number formula in the page header to evaluate later but Crystal won't do it.
The only way I can think of to accomplish this is if you can find another way to handle the conditional suppression - something based on record count or the like that could be evaluated during the whilereadingrecords phase so there is time in the whileprintingrecords phase to do something with the information.
frodoman
I agree. SInce you add the page, it gets counted.
You might be able to set a flag in the section but I suspect it will be set too late to be useful.
mlmcc
You might be able to set a flag in the section but I suspect it will be set too late to be useful.
mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nice! Very creative solution bdreed.
frodoman
frodoman
ASKER
Excellent!
I followed the instructions and then moved the logic onto my statement report. The solution provided by bdreed35 has sorted out the page numbering issue, and added an extra page whenever the group ends on an odd number. :)
There is a slight problem with my summing up at group level. The total transaction amount needs to be displayed at the bottom of the last page where there are transactions. - "print at bottom of page" on the group footer seems to add an extra page even if the statement ends on an even number.
Guys - I'm new to this - Do I accept the solution and open another follow up issue?
Frixos
I followed the instructions and then moved the logic onto my statement report. The solution provided by bdreed35 has sorted out the page numbering issue, and added an extra page whenever the group ends on an odd number. :)
There is a slight problem with my summing up at group level. The total transaction amount needs to be displayed at the bottom of the last page where there are transactions. - "print at bottom of page" on the group footer seems to add an extra page even if the statement ends on an even number.
Guys - I'm new to this - Do I accept the solution and open another follow up issue?
Frixos
ASKER
Hi,
Managed to solve the totals issue!
I moved the total to the page footer and conditionally show it using both the suppress_flag and a new suppress_footer_flag. This new variable switches to 'false' in Group Header 1 and to 'true' in Group Footer 1b.
Thanks again to frodoman and bdreed35 for taking the time to help me with this issue. :)
Frixos
Managed to solve the totals issue!
I moved the total to the page footer and conditionally show it using both the suppress_flag and a new suppress_footer_flag. This new variable switches to 'false' in Group Header 1 and to 'true' in Group Footer 1b.
Thanks again to frodoman and bdreed35 for taking the time to help me with this issue. :)
Frixos
if totalpagecount mod 2 = 1 then
totalpagecount - 1
else
totalpagecount;