Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Number Generation Post Reply Post New Topic
Author Message
Trisha22191
Newbie
Newbie
Avatar

Joined: 15 Apr 2008
Online Status: Offline
Posts: 10
Quote Trisha22191 Replybullet Topic: Number Generation
    Posted: 15 Apr 2008 at 11:42am
I am trying to generate a serial # for a report I created for preprinted time sheets.
I have the parameter asking the total # of timesheets needed but I cannot figure out how to sequentially generate the serial # using the entered value.
The format of the number is: 2008-AAA-000x (where x starts at 1 and ends at given number.  So if I enter 4, I should have the following:
 
2008-AAA-0001
2008-AAA-0002
2008-AAA-0003
2008-AAA-0004
 
The formula I have only puts 0001 at the end and prints the same thing on all 4 pages.
 
Any suggestions?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 15 Apr 2008 at 12:33pm

Is there always only one page per timesheet?  Are you resetting the page numbers at all?  If the answers are "Yes" and "No", respectively, try this:

'2008-AAA-' + right('000' + To_Text(PageNumber, 0), 4)
 
-Dell
IP IP Logged
Trisha22191
Newbie
Newbie
Avatar

Joined: 15 Apr 2008
Online Status: Offline
Posts: 10
Quote Trisha22191 Replybullet Posted: 15 Apr 2008 at 12:51pm
Will this work if the # of pages changes each time the report is run?
This report will be run weekly and the number to generate could be anywhere from 250-275 pages.  The # of pages will be entered by the user.
 
Could I alter it to have the last number in the formula be the parameter?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 15 Apr 2008 at 2:56pm
Yes, it will work if the number of pages changes.
 
If you change it to the parameter, it will always be the value of the parameter.  My understanding was that you wanted each page to have a different number.  I may have misunderstood what you wanted, though.
 
-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.015 seconds.