Options

NAV 2016 Word report is generating extra 0

Hi,

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, NAV writes "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".
In the picture "No error" I have shown how I would like it to look.

Can somebody help me?

Best Answer

Answers

  • Options
    roberto.stefanettiroberto.stefanetti Member Posts: 2
    hi,
    you can use this function Num2Str
    called in fields of dataitem ex: Num2Str(Quantity)

    Num2Str(IdecValue : Decimal) OtxtValue : Text[100]
    IF IdecValue<>0 THEN BEGIN
    OtxtValue:=FORMAT(IdecValue,0,'<Precision,2:2><Standard Format,0>');
    END;
    Roberto Stefanetti, MVP
  • Options
    carsten_toftcarsten_toft Member Posts: 2
    Thank you for the fast answer.

    Can this code be integrated directly in Word?
Sign In or Register to comment.