Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: if then else.... Post Reply Post New Topic
Author Message
azza
Newbie
Newbie


Joined: 31 Mar 2011
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote azza Replybullet Topic: if then else....
    Posted: 31 Mar 2011 at 1:28am
I'm attempting to report on a SQL database using Crystal Reports, and I've managed to get quite far before getting stuck. My current setup shows if a record meets a condition, it then shows a text field based on that:

if {Calibrations.Preset} = True then 'Preset Value:' else 'Max Capacity:'

What I'd like to do is extend that a bit, so that if {Calibrations.Preset} = True then not only does it display 'Preset Value:', but it also displays the {Calibrations.PresetValue} variable, or if not, then it displays the {Calibrations.MaxCapacity} variable after 'Max Capacity:'

I've had a play around with the syntax, and had a thorough Google, but I don't seem to be able to find what I need. Does this make sense to anyone out there please?
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 31 Mar 2011 at 2:07am
You need to concatenate the text with the variable using &. Be sure to put a space within the quotes so that the string does not butt up too close to the variable:
 
if {Calibrations.Preset}=True
     then 'Preset Value: ' & {Calibrations.PresetValue}
          else 'Max Capacity: ' & {Calibrations.MaxCapacity}


Edited by FrnhtGLI - 31 Mar 2011 at 6:26am
|< /\ '][' ( )
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.032 seconds.