Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Force CR10 Specific Number of Pages to Print Post Reply Post New Topic
Author Message
preacher_g
Newbie
Newbie
Avatar

Joined: 30 Dec 2008
Online Status: Offline
Posts: 8
Quote preacher_g Replybullet Topic: Force CR10 Specific Number of Pages to Print
    Posted: 30 Dec 2008 at 11:38am
All,
I have been tasked with what seemed to be a plausible project, but it has turned into a real headache. Ouch

I have a report request for 6 barcodes on a page that have the current timestamp.  No problem - that's easy...  However, the User could ask for more than one page and each page needs to have the current timestamp at the time THAT page printed.  So, in theory, page one is for 6 barcodes at 12:00 and page two for 6 barcodes at 12:01, etc, etc, for as many pages the User needs.

I have a parameter question that asks the User how many pages to print, but no way of turning that input parameter into something that Crystal can use to print that number of pages.

There is no datasource - I was instructed to develop this "masterpiece" as a standalone CR report.

Any suggestions?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 30 Dec 2008 at 1:38pm
How is your report currently designed?  Are the 6 barcodes all in one detail section?  Are you using the CurrentTime function? What is the maximum number of pages that can be requested?  The answer to this will determine which of a couple of different options I give you to resolve the issue.
 
There are ways to use multiple sections with "New Page After" and conditional suppression to get you multiple pages of bar codes based on your parameter.  However, the "CurrentTime" function gives you the print time of the report, not of the individual pages.  I have some thoughts on how you could use formulas to "fudge" that, though, but I need to know the max number of pages.
 
-Dell
IP IP Logged
preacher_g
Newbie
Newbie
Avatar

Joined: 30 Dec 2008
Online Status: Offline
Posts: 8
Quote preacher_g Replybullet Posted: 30 Dec 2008 at 2:21pm
hilfy- Thanks for responding...

The specs say there is no limit to the number of pages, but I am not above giving one.  50 sounds reasonable for the application of the barcodes (Each page is to produce 6 barcoded labels with a timestamp for that sheet.  These labels are then placed on all the flat surfaces of a cardboard box).

As for the design, I currently have the 6 barcodes in one details section.  I created a formula using the "CurrentDateTime" function and placed that in the report to make it easier to format into a barcode.  I realize the function pulls the time of printing, but I was hoping to come up with a way to fudge it - so we are on the same page regarding that.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 30 Dec 2008 at 3:24pm
50 pages is going to be a lot of work, but it is doable.
 
Create a formula that will give you the "fudged" print time.  It will formula will look something like this:
 
CurrentDateTime + (0.000016 * (PageNumber - 1))
 
"0.000016" comes from the way that date math works.  The number 1 represents one day (24 hours).  So, to get the value for 1 second, I divided 1 by 24 (hours) and the divided the result by 60 (minutes in an hour) and by 60 again and I rounded up the value.  So, for each page, you're adding roughly 1 second to the time.
 
For each page, you'll have to add a separate section to the report (I assume you're using a details section for this...).  Place your barcodes using the formula from above.  Then format the section and do the following:
 
1.  Turn on "New Page After".
2.  Click on the formula button to the right of "New Page After" and add something like the following:
   PageNumber >= {?Page Count Parameter}
This will prevent a blank page from printing at the end of the report.
3.  Click on the formula to the right of "Suppress" and add something like the following:
  {?Page Count Parameter} < [whatever page this section will print]
 
So, for page 2 it would be {?Page Count Parameter} < 2.
 
I haven't actually tried this, but I think it will work.
 
-Dell
IP IP Logged
preacher_g
Newbie
Newbie
Avatar

Joined: 30 Dec 2008
Online Status: Offline
Posts: 8
Quote preacher_g Replybullet Posted: 30 Dec 2008 at 7:58pm
hmmm - sounds good.

I'll give it a try over the New Year's vacation and let you know....

Happy New Year & Thanks!
IP IP Logged
preacher_g
Newbie
Newbie
Avatar

Joined: 30 Dec 2008
Online Status: Offline
Posts: 8
Quote preacher_g Replybullet Posted: 04 Jan 2009 at 1:07pm
Wahoo!

It runs great!  You are correct - 50 pages is gonna be a bear.  I'm going to set it up for 5 and then play it by ear to see what they actually use.

Incidently, the client changed their specs (again) and this is now supposed to run on Crystal XI; which it does!

Thank you sooooo much!
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.