NAV 2015

Word Layout reports data control by C/AL

word layout

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.
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).


Num2Str (IdecValue: Decimal) OtxtValue: Text [100]
IF IdecValue <> 0 THEN BEGIN
OtxtValue: = FORMAT (IdecValue, 0, ‘<Precision, 2: 2> <Standard Format, 0>’);

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);
etc etc.


3 risposte »


Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:


Stai commentando usando il tuo account Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...