Print Page | Close Window

Way to display string when field of int type null

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=23016
Printed Date: 04 May 2024 at 9:24am


Topic: Way to display string when field of int type null
Posted By: DDSJ
Subject: Way to display string when field of int type null
Date Posted: 23 Aug 2022 at 1:42am
Is there any approach to display 'NA' in place of blank when Field of numeric type is null in database. I do not want to convert the field type to char type using user formula as the requirement is to use the numeric type in other formulas. However I want to display 'NA' if the filed value is null or blank in database. Is there any way to achieve it ?

Please help

Thanks



Replies:
Posted By: kevlray
Date Posted: 23 Aug 2022 at 3:55am
in a formula. You can for display purposes convert the number to a string.  That way you can display the NA.  I.e., if isnull(fieldvalue) the 'NA' else cstr(fieldvalue)


Posted By: DDSJ
Date Posted: 02 Sep 2022 at 12:59am
The difficulty is that I cannot convert number to string in formula field as I have to display the report in multiple languages and my formulas have calculations which fails if I convert number to text. So is there any way to provide border or lines on field when value of field is null if to display NA is not possible. Either way will work.(NA or border around null)
Please help

Thanks in advance


Posted By: lockwelle
Date Posted: 02 Sep 2022 at 8:25am
Here a trick you could use:

Have 2 fields the same size and the same location. If the value is null, hide one and display the field/cell with NA in it. When it is not null, hide the NA cell and display the calculation results.

if there are a lot of calculated cells, this can be tedious...

HTH


Posted By: DDSJ
Date Posted: 05 Sep 2022 at 4:11am
This solution worked for me.
Thankyou so much for the support.



Print Page | Close Window