Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Tips and Tricks
Message Icon Topic: CR X1 - ensuring reports are a set number of pages Post Reply Post New Topic
Author Message
DavidSmith
Newbie
Newbie


Joined: 06 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote DavidSmith Replybullet Topic: CR X1 - ensuring reports are a set number of pages
    Posted: 04 Nov 2008 at 2:31am
Hi, a tip for some of you. I spent some time - and paid some consultants - trying to find an answer to the problem I had. In fact a 'eureka' moment hit me in the shower and here's the answer.
We produce a lot of financial reports that are created as pdfs and are then sent to a 'printers' for turning into A4 brochures for the client. Each one is printed on A3 sheets that are then bound etc into A4 which means the reports have to be a fixed number of pages, ie 8, 12, 16 or 20 (etc), i.e. divisible by 4.
In the end I created 3 sections in CR that basically are 'Blank page left for notes' style text boxes with each one having a page break after it. The supression of each of these sections is controlled through a report parameter. From within my Windows app, I set all 3 parameters to 'suppress', determine how many pages the report is and then re-set the parameters accordingly and then print the report. i.e. if the report has a 'natural count' of 11 pages, then I set one of the parameters to false and therefore that section (and page) is not supressed, which then gives me 12 pages! Smile
Don't know whether this will ever help anyone but it sure felt good when it worked the first time. Just a shame I was £500 worse off with paying those consultants to come up with an idea which didn't work! Cry
David Smith
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 07 Nov 2008 at 1:55pm

Instead of using parameters, you could also use the "Total Page Count" special field and do something like this in the suppression formula:

For the first blank section:
TotalPageCount \ 4 = 0
 
For the second:
TotalPageCount \4 <= 1
 
For the third:
TotalPageCount \4 <= 2
 
Using the modulus operator '\' (as opposed to the division operator '/') gives you the remainder of the division operation.  So this looks at the remainder when you divide the page count by 4 and determines which sections need to be printed.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.