Print Page | Close Window

Number Generation

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2934
Printed Date: 02 May 2024 at 11:13pm


Topic: Number Generation
Posted By: Trisha22191
Subject: Number Generation
Date 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?



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


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


Posted By: Trisha22191
Date 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?


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


-------------
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