Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula Help-WhilePrintingRecords Post Reply Post New Topic
Author Message
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Topic: Formula Help-WhilePrintingRecords
     Posted: 06 Oct 2010 at 9:51am
I have taken over the responsibilities of refreshing and distributing a CR report that was created by another employee that was transferred to another dept.

There are several formulas that he has on the report that I'm unfamiliar with. Here's the first one:

WhilePrintingRecords;
Global NumberVar LineNumber = 0;

LineNumber := LineNumber + 1;

Could somebody let me what this formula does when printing? And why would he use this on the report?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Oct 2010 at 10:08am
it is just a counter.
could be used to count rows or groups depending on where it is placed in the report canvas.
lots of reasons to do it so hard to say.


Edited by DBlank - 06 Oct 2010 at 10:09am
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 06 Oct 2010 at 10:18am
Sorry, I forgot to mention that it's on the 'Detail' row, and it is used to count the number of records. I normally use the 'Running Total Fields' for this. Would it make a difference?

The 'Running Total' seems easier to me since I'm not that familiar with writing formulas.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Oct 2010 at 10:24am
I prefer RTs too. I find them much easier to use. 
IMO...
Generally speaking there is no reason not to use an RT over a variable formula field, generally just a matter of preference.
In some more complex cases it may be wiser to use formulas.
Only thing you have to watch for here is if he used that formula in anything else or if he has another reset fomrula to count rows in a group (same thing as resetiing in an RT).


Edited by DBlank - 06 Oct 2010 at 10:24am
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 06 Oct 2010 at 10:33am
Although the report is grouped by 12 different employees, the record numbers don't reset by group, which is what I think I would have done.

Anyway, thanks for the help.
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