Print Page | Close Window

CR X1 - ensuring reports are a set number of pages

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4711
Printed Date: 01 May 2025 at 8:29pm


Topic: CR X1 - ensuring reports are a set number of pages
Posted By: DavidSmith
Subject: CR X1 - ensuring reports are a set number of pages
Date 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



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window