Some have asked me (both on Dynamics Community and Mibuso) how to use in NAV Word Layout reports property to hide the value 0 or other values in fields under conditions.
Sample of question: “I have made a report in NAV 2016 using Word and XML. Everything is very well, but I have one problem. When “quantity” is added to the report, writes NAV “0” in all cells with no information. In the attached picture saying “with error” you can see That the “quantity” cell with no information is filled with “0”.”
Question ref. http://forum.mibuso.com/discussion/67111/nav-2016-word-report-is-generating-extra-0
Answer
“No, only in C / SIDE in this case (simple common solution), the use in this way (no logic in Word, all in C (SIDE) .. but .. i think That you can create functions in Word (macro) ,in word template. you can modify XML an add also Javascript support… an so on..”
Some functions can be used with C / AL
With these sample functions you can simulate what is done by the visibility property of the RDLC report or by VBNET Functions included in the report (Public Functions on CODE section of reports).
Examples
Num2Str (IdecValue: Decimal) OtxtValue: Text [100]
IF IdecValue <> 0 THEN BEGIN
OtxtValue: = FORMAT (IdecValue, 0, ‘<Precision, 2: 2> <Standard Format, 0>’);
END;
Num2Str2 (IdecValue: Decimal) OtxtValue: Text [100]
OtxtValue:=FORMAT(IdecValue,0,'<Precision,2:2><Standard Format,0>’);
Int2Str (inValue: Integer) OtxtValue: Text [100]
IF inValue <> 0 THEN BEGIN
OtxtValue: = FORMAT (inValue);
END;
..
etc etc.
Still using Hungarian notation? Time to attend one of my classes Roberto… 😉
eh eh… i like “brain damage” coding…