Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: "This" Field Post Reply Post New Topic
Author Message
patton77
Newbie
Newbie


Joined: 03 Feb 2014
Online Status: Offline
Posts: 2
Quote patton77 Replybullet Topic: "This" Field
    Posted: 04 Feb 2014 at 11:39am
Hi all

My apologies if this is a stupid question, I cant find a answer for this one...I am not a programmer so go easy on me....

Is there anyway I can get a field to reference itself without having to refer to the actual field name in the formula.

I have a bunch of fields I need to write basic script for and change the field name, but if I could get the field name to reference itself, I could just write the one script and it could apply to all fields.

for example my code for the myfield1 field is

If {mytable.myfield1}=5 then crGreen else
If {mytable.myfield1}=1 then crRed
else crwhite

and myfield2

If {mytable.myfield2}=5 then crGreen else
If {mytable.myfield2}=1 then crRed
else crwhite

however, I would prefer

If {mytable.thisfield}=5 then crGreen else
If {mytable.thisfield}=1 then crRed
else crwhite

That way the one script is applied to all fields.

Hope someone can help



Edited by patton77 - 04 Feb 2014 at 11:39am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2014 at 12:09pm
currentfieldvalue
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2014 at 12:10pm
write it on one and paint it onto the other fields
IP IP Logged
patton77
Newbie
Newbie


Joined: 03 Feb 2014
Online Status: Offline
Posts: 2
Quote patton77 Replybullet Posted: 04 Feb 2014 at 2:46pm
thank you very much !
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.047 seconds.