I have a numeric column in which I'd like to represent nulls as 0. I'm using the following display format 0.### but I'm still getting blank spaces instead of a 0. Is there something else I need to do?
No, this is simply the way ReportBuilder works . Null values are one of the most difficult items to handle so we decided to leave it up to the developer how they would like them displayed. The entered display format is not even taken into account when there is nothing to format.
I don't mind setting the OnGetText method, I just hate to do it for every field every time I write a report. The alternative is to modify my db queries so that they check for nulls and return 0 instead. Again, though that's for every field. I feel like I'm losing the benefit of having a dataware field.
I understand why you did what you did, but it sure would be nice if there were a more elegant solution. There is a "Blank when zero" option (which BTW is not in the help file) so maybe a "Zero when NULL" option would help. Maybe even a "Apply display format to null values" would apply. I realize there's nothing to format, but the literals would show.
Comments
By default, a null field will just print blank. Try using the OnGetText to
check if the field value is null, then printing a "0" if it is.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
No, this is simply the way ReportBuilder works . Null values are one of
the most difficult items to handle so we decided to leave it up to the
developer how they would like them displayed. The entered display format is
not even taken into account when there is nothing to format.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
field every time I write a report. The alternative is to modify my db
queries so that they check for nulls and return 0 instead. Again, though
that's for every field. I feel like I'm losing the benefit of having a
dataware field.
I understand why you did what you did, but it sure would be nice if there
were a more elegant solution. There is a "Blank when zero" option (which BTW
is not in the help file) so maybe a "Zero when NULL" option would help.
Maybe even a "Apply display format to null values" would apply. I realize
there's nothing to format, but the literals would show.
enhancements.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com