Problem in crystal report null value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Priyam Ganguly

    Problem in crystal report null value

    Hello everyone,
    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.
  • =?Utf-8?B?SkI=?=

    #2
    RE: Problem in crystal report null value

    One possibility is to change the procedure in the database

    Instead of SELECT ..., EntryDate, ....

    use SELECT ..., (CASE WHEN EntryDate = NULL
    THEN 'Not available'
    ELSE CONVERT( ..EntryDate to string..)
    END ) AS EntryDateName, ..........

    and then change the report to expect a string instead of a date
    I don't remember the arguments for CONVERT off hand.
    --
    JB


    "Priyam Ganguly" wrote:
    Hello everyone,
    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.
    >

    Comment

    Working...