Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Row Count Post Reply Post New Topic
Author Message
coountsr
Newbie
Newbie


Joined: 23 May 2013
Online Status: Offline
Posts: 20
Quote coountsr Replybullet Topic: Row Count
     Posted: 28 May 2013 at 4:01am
I am needing to start a row count with 0 instead of 1. Is there a way to do this?
 
Thanks,
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 28 May 2013 at 5:30am
I would think that you could do it two different ways.  Create your own row counter using shared variables or use RowNumber -1.
IP IP Logged
coountsr
Newbie
Newbie


Joined: 23 May 2013
Online Status: Offline
Posts: 20
Quote coountsr Replybullet Posted: 28 May 2013 at 6:02am
I am new to Crystal, how would I do either of these functions?
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 29 May 2013 at 3:12am
Hi

Try this :

WhilePrintingRecords;
numbervar x;
if not onfirstrecord then
x:=x+1;
Thanks,
Sastry
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 29 May 2013 at 5:32am
I think your second line would need to be Global Numbervar x; or Shared Numbervar x;  Otherwise the variable will lose it value.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 29 May 2013 at 5:53am


No. In Crystal if you are not mentioning anything before declaration, it takes Global by default.

Shared will be used only when you pass values from sub report to main or main to sub

Thanks,
Sastry
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 29 May 2013 at 10:03am
I remember that, Global never works properly for me.  I end up making a lot of variables shared.
IP IP Logged
coountsr
Newbie
Newbie


Joined: 23 May 2013
Online Status: Offline
Posts: 20
Quote coountsr Replybullet Posted: 30 May 2013 at 10:43am
That worked! Thank you so much for your 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