Decimal Should Print As Blank if it is Zero.....!

HI,

I am designing a RTC Report Where i Have Decimal Field,Which i am unable to make it blank if it is Zero.

I can do this by mentioning in the table,But i Can’t do it right now.

How can i make it Blank…?

Thanks & Regards

Shravan Kumar

Hi,

Use format function in variable in classic report.

Have a look at e.g. report 6 in Visual Studio at the Value property of an amount field.

You can see for example: =Code.BlankNegAndZero(Fields!G_L_Account___Balance_at_Date__Control24.Value).
There is also a function for BlankZero. You can change it there.

If you run the Suggest Layout from CC this is automatically done by looking at the BlankNumbers property of the text box in the classic report.

Hi Amol,

Yeh U r right,But that field is used at many places in the classic.so i can’t do that.so Could say another way to do from RDLC only(In VB)…

Thanks

Shravan

Why and what cant you do that?

HI thomas,

Yeh u r right ,But i have to use that function on a field as decimal only.

i can’t do as u suggested,B’coz in my classic report i used that in many places.

so i can’t use FORMAT on it in classic.so i have to do it as it is,i.e.,as Decimal only…

Decimal Should Print As Blank if it is Zero…! in the rtc.And m unable to use format in this case.plz sugget any other way…?

How can i use bankzero function on decimal in the RDLC…?

Thanks

shravan

Perhaps you are confused. You don’t have to change it in the table to show on a report.

YOu can create a text field to hold your value for report display only.

IF MyDecimalField = 0 then
MyTextField := ‘’ else
MyTextField := FORMAT(MYDecimalField);

& Use MyTextField as the SourceExp of your Textbox.

I know this is an old one, but why not use the code.BlankZero function directly in RDLC.

The problems I see in using the fields as text fields is that this will prevent you from using the other build-in RDLC functions such as SUM etc.

On the RDLC field just add code.BlankZero( to the field expression, ex. “=code.BlankZero(Fields!MyField.value)”.

The functions are automatically build into any NAV 2013 and up versions, but in NAV 2009 you have to do them your self. But take a look at how its used on the amount and discount fields in report 206 (Sales Invoice).