30 pts.
 Problem in Crystal report null value.
Hi, I hav been facing a problem since a few days. I'm using crystal report with vb.net 2005 (.Net framework 2.0). In a report I'm retrieving the values from a database table and showing it. But the problem is that if a certain field is blank in database then it's showing a complete blank white field in the report also. This is what I don't want. For example- suppose there's a field in datbase named EntryDate which is not mandatory. So for a certain row if there's an entry for EntryDate it'll show it in the report otherwise if it's blank or null in database it'll show a user defined string in the report say 'Not Available' or something like that. For this I hav tried playing with the ZeroValueString property of the respective field in the crystal report also but of no avail. How can I solve it. Plz help with some code example. Regards.

Software/Hardware used:
ASKED: September 24, 2008  10:55 PM
UPDATED: April 15, 2010  5:22 AM

Answer Wiki:
This may not be exactly what you are looking for, but, it is not possible for you to change your query using the ISNULL function on the fields that can contains NULLS ? (I'm assuming that when you say "blank" you mean null). If your field is of date type, you might want to change it to a character type, and convert the data in your query, using some function like CAST or DATENAME, so you can set some string as default value for nulls. Hope this helps. For date fields you can use something like this. ISNULL(CONVERT(VARHCAR(10), YourField, 101), 'Unavailable') For text strings you'll do the same thing without the CONVERT function. *********************************************************************************** How about using a formula ? Something like this: <pre>If isNull({someData.EntryDate}) Then "Not Available" Else {someData.EntryDate}</pre> This would work if the field is of String type. If not, the data should be converted to that type.
Last Wiki Answer Submitted:  September 25, 2008  10:17 pm  by  Denny Cherry   64,550 pts.
All Answer Wiki Contributors:  Denny Cherry   64,550 pts. , carlosdl   63,580 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Yeah you got it right. I have applied the same idea as in the last but one line. It works good. But actually I am looking for something by which I can manage it during the design time so that I wont hav to mess up the base sql query. For example there’s a property in Crystal Report for text fields called ZeroValueString. Accordingly, it does the same thing. I tried to use it but couldn’t figure out what’ll be its proper format. Can U plz focus a bit on it. Thanks to all for ur help.
Regards.

 30 pts.