Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: field_exists() Post Reply Post New Topic
Author Message
loftinsulation
Newbie
Newbie


Joined: 03 Nov 2008
Online Status: Offline
Posts: 6
Quote loftinsulation Replybullet Topic: field_exists()
     Posted: 05 Jun 2009 at 1:01am
Hello
 
I make extensive use of custom templates when reporting to save on formatting etc and I want to include formulas in them.  I want to encase my formulae in an
 
if field_exists({table.field}) then ...
 
type structure to avoid the annoying error messages.  Can this be done?
 
Kindest regards
lofty
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 05 Jun 2009 at 6:51am
I am going to guess no.
 
Crystal expects the data to exist.  You can have extra fields that aren't used in the report, and Crystal doesn't care, but if you are missing a field, it gets upset.
 
I don't see any functions that deal with fields/data existing.  Again, I think that Crystal presumes if it is on the report, it must be 'in the data' since you can't create a formula without the field existing.
 
What you can do, I think (since my template is very simple), is to create 'Report Custom Functions' (my repository doesn't work, so I can't suggest that).  Since a function is data independent, if you have formatting or calculaltions that recur, you could call the function passing in the 'correct' field and crystal SHOULD be happy with that.
 
HTH
IP IP Logged
loftinsulation
Newbie
Newbie


Joined: 03 Nov 2008
Online Status: Offline
Posts: 6
Quote loftinsulation Replybullet Posted: 05 Jun 2009 at 8:13am
Bonza idea - will give it a try.
 
Much obliged.
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