Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Numbering controlled Post Reply Post New Topic
Author Message
xavendano
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Online Status: Offline
Posts: 9
Quote xavendano Replybullet Topic: Numbering controlled
     Posted: 22 Apr 2009 at 1:46pm
Greetings,

A report by generating a new and unique serial number for each print section of the report header. The report header is printed for every 100 records in detail.
As the number of registers is finite and it is always the same (not added or deleted entries). His impression is always the same.


How can I generate this in a controlled variable from CrystalReport for VS2008.net beginning with 1 and incremented by 1 for every 1 Report Header is printed?

Thanks to all,
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Apr 2009 at 6:23am
sounds like you could use a shared variable that is incremented in the report header...every time the report header is displayed, the shared variable is incremented and displayed.
 
Wait...Report header is only called once per report, so how are getting the report header to be printed every 100 items of detail...
IP IP Logged
xavendano
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Online Status: Offline
Posts: 9
Quote xavendano Replybullet Posted: 23 Apr 2009 at 6:45am
Hello lockwelle,

Indeed the Report Header is printed only once. I put my header on the form to the Page Header and then apply a condition for Supress 100 records to be displayed only when appropriate.

This way I get the report in the way I need it. So how to generate the serial number? You speak of a shared variable, can you tell me some examples?

Thank you
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Apr 2009 at 7:11am
one formula in the report header, or wherever you want the number to print...
 
shared numbervar Serial := Serial + 1
 
this will increment everytime the formula is run, which would be as often as the band it is located in is displayed.
 
 
IP IP Logged
xavendano
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Online Status: Offline
Posts: 9
Quote xavendano Replybullet Posted: 23 Apr 2009 at 8:33am
Excellent Lockwelle, works fine!!!
 
I just have to put a condition but works fine!!!
 
Thank you!
IP IP Logged
xavendano
Newbie
Newbie
Avatar

Joined: 22 Apr 2009
Online Status: Offline
Posts: 9
Quote xavendano Replybullet Posted: 24 Apr 2009 at 8:29am
How do I format the variable?
Ie, a desire to be in a format similar to "00001" instead of "1".

Thank you
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 27 Apr 2009 at 6:21am
Hmmm...haven't needed to do this in a while.  First one that comes to mind is to use the format command, but if that doesn't work, something like
right("000000" + totext(variable, 0,""), 6) will work.
IP IP Logged
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