Line break Docx From Dynamic Template

Hi,

I'm trying to insert a break line inside the xml that will build the docx from Dynamic template, I tried with <br>, char(10), but I don't know what to try anymore.

anyone have ideas?  

the error log: "Changed to The value of attribute "daybefore" associated with an element type "rowvalues" must not contain the '<' character." if I use <br>

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    "<br>" is HTML - to do manual trickery with Word files, you need to use the Word-flavored XML codes (not HTML), aka WordML.  I'm not exactly sure what syntax you'd need to use to do this within the Docx from Dynamic Template smart service, but the WordML carriage return is: <w:br/>

    In the "word document from template" (older) smart service, it's possible to use the above by passing it in after a "text breakout" flag ("</w:t>") and then following it with another "text start" flag ("<w:t>").  Without doing these first it just tries to render as plaintext (though also the "<" and ">" characters cause issues if not sanitized first).  Again, it's all liable to be different in the "...Dynamic Template" smart service, so you'll need to experiment.

  • thx Mike, I resolved with "&#10;" as line break using advanced document templat

  • 0
    Certified Associate Developer
    in reply to cugino95

    Hi Cugino95,

    How did you solve it?

    Could you help with exact expression to solve this problem?

    My issue is:

    • Text entered in a paragraph field on UI.
    • Generated DOCX from dynamic template shows the new lines entered in the paragraph field fine.
    • PDF from DOCX(generated docx) is not showing the new line but in same line.

    Tried below snip:

    substitute(
      ri!multiLineText,
      char(10),
      "</w:t><w:br/><w:t>"
    )

    Generated docs has this:

    &lt;/w:t&gt;&lt;w:br/&gt;&lt;w:t&gt;Text Data &lt;/w:t&gt;&lt;w:br/&gt;&lt;w:t&gt;

    Thanks

  • 0
    Certified Lead Developer
    in reply to keerthik0010

    Generated docs has this:

    &lt;/w:t&gt;&lt;w:br/&gt;&lt;w:t&gt;Text Data &lt;/w:t&gt;&lt;w:br/&gt;&lt;w:t&gt;

    Your generated doc is receiving sanitized text (instead of the literal "<" and ">" symbols), which will not work.  To get the wordML trick to work, the literal symbols must be passed in.

Reply Children
No Data