Options

Carriage return in word

ArkananArkanan Member Posts: 28
edited 2013-11-25 in NAV Three Tier
Hi all,

I'm trying to add a field in a merged word document but i'm facing an issue with carriage return in this field: The field is a concatenation of different records, and i want this records to be split by a carriage return. But when the field is displayed in word document, ther's no carriage return, and the reccord are displayed on the same line.

Here's the code:
CU WordManagement, Trigger ShowMergedDocument
      Comment.SETRANGE("Document Type", SalesHeader."Document Type");
      Comment.SETRANGE("Document No.", SalesHeader."No.");
      IF Comment.FINDSET THEN BEGIN 
      CRLF[1] := 10;
      CRLF[2] := 13;
        REPEAT
          Commentaire := Commentaire + CRLF + Comment.Description
        UNTIL Comment.NEXT = 0;
      END;
      AddField(Commentaire);

I'd like to have a result like this:
comment1
comment2
comment 3

But I have:
comment1comment2comment3

I searched on this forum and others for hours but nothing I've tried successed...

Thanks for help,

Ark@

Edit: I'm working on NAV 2009 :)

Comments

  • Options
    ppavukppavuk Member Posts: 334
    i am not sure but seems you sending LFCR as
    cr is 0x0D and lf is 0x0A.

    So, you code should be like:

    CRLF[1] := 13;
    CRLF[2] := 10;
  • Options
    ArkananArkanan Member Posts: 28
    Oh, you're right.

    I changed the values but it doesn't work neither :/

    Any ideas? [-o<
  • Options
    ArkananArkanan Member Posts: 28
    Hi all,

    I'm still facing this issue so if someone would have some clue or ideas about that it woulb be really helpfull to me.

    Thanks in advance,

    Arka
  • Options
    geordiegeordie Member Posts: 655
    In ShowMergedDocument sometimes some html tag is written in the file...can you give a try using "<br>" as carriage return instead of CRLF string?
  • Options
    ArkananArkanan Member Posts: 28
    Hi geordie,

    It works great, thanks a lot!! =D>
    Didn'it even think to use HTML synthax :o You save me^^

    Thanks again

    Ark@
Sign In or Register to comment.