Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: auto increment when more than one code the same Post Reply Post New Topic
Author Message
SAM_N
Newbie
Newbie


Joined: 17 Apr 2013
Location: Australia
Online Status: Offline
Posts: 3
Quote SAM_N Replybullet Topic: auto increment when more than one code the same
    Posted: 19 Jan 2014 at 7:37pm
Hi,
I have been asked to create a report with a feature that i am not sure how to achieve.

we are reporting on position codes and often there is more than one employee using the same position code as another.

I have been asked to auto increment any position code which appears more than once.

so: pos code ERT001 initially - then any further incidents of ERT001 are marked as ERT001/1, ERT001/2, ERT001/3 etc.

Any thoughts on how I can achieve this?

Thanks
Sam
Sam
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Jan 2014 at 4:59am
Either gather the data via a stored proc, which would allow you to change the value

or

group by the position code and then you could use a formula (or a group of them)
in the group header:
shared booleanvar addend:=false;
shared numbervar ending:=0;
if count({table.positionCode}) > 1 then addend:=true;
addend;
""//hide the random true

in the detail section for the group code:
shared booleanvar addend;
shared numbervar ending;
if addend then (
ending := ending + 1;
{table.positionCode} + "/" + totext(ending,"",0);
)
else
{table.positionCode}

one of these should do it for you....

HTH
IP IP Logged
SAM_N
Newbie
Newbie


Joined: 17 Apr 2013
Location: Australia
Online Status: Offline
Posts: 3
Quote SAM_N Replybullet Posted: 21 Jan 2014 at 10:37am
Thanks for your reply - I will give that a go!
appreciate your time. Sam
Sam
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.016 seconds.