Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Report Question Post Reply Post New Topic
Author Message
vkcrystal
Newbie
Newbie


Joined: 29 Jan 2008
Online Status: Offline
Posts: 9
Quote vkcrystal Replybullet Topic: Report Question
    Posted: 19 Feb 2008 at 3:35pm
Guys,
One of the Field on the Report  default value is "Select". If there is no value in that field i am getting the value as "Select" on the Report. I want to leave the field blank if it is "Select". I am using the IF Condition but it is not working. Any idea.
 
if {tbl1.te} = "Select" then
{tbl1.te} = " "
else
end if
Appreciate your help
Thx

 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Feb 2008 at 4:14pm
Where are you setting the default value to be "Select"? In this formula, or somewhere else?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
vkcrystal
Newbie
Newbie


Joined: 29 Jan 2008
Online Status: Offline
Posts: 9
Quote vkcrystal Replybullet Posted: 19 Feb 2008 at 5:44pm
Brian,
 
Default value "Select" is coming from the Database.
Thx
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Feb 2008 at 8:52pm
Interesting. I thought you found some new way to get CR to insert default values that I didn't know about. 

The formula is trying to overwrite the value of the database field and you can't do this. You just have to make the formula return the proper value and then put the formula on the report where you previously had the database field located. Then the report displays the formula value rather than the database field.

if {tbl1.te} = "Select" then
    ""
else
    {tbl1.te}


I have three chapters about writing formulas with plenty of sample code in my book Crystal Reports Encyclopedia.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
vkcrystal
Newbie
Newbie


Joined: 29 Jan 2008
Online Status: Offline
Posts: 9
Quote vkcrystal Replybullet Posted: 21 Feb 2008 at 1:47pm
Brian,
 
I tried this one but it is not working, just wonder why? such a small thing. It is not giving any error but still it displays the value "Select"
Any Idea
Thanks
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.031 seconds.