Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Putdocx table and linebreak

    Hello,

    Is it possible to add linebreak into putdocx table ?

    I have something like that with a random example :

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    putdocx begin
    local val1=(2/4)
    local val2=(1/4)
    local val3=(3/4)
    putdocx table mytable=(2,2)
    putdocx table mytable(1,1)=(string(`val1', "%3.1f") + " [" + string(`val2', "%3.1f") + "-" + string(`val3', "%3.1f") + "]")
    putdocx save test, replace
    So the result is : 0.5 [0.3-0.8] into my cell
    But i would like to get a linebreak after 0.5 and before [ like that :
    0.5
    [0.3-0.8]

    Is it possible ?
    Thanks

  • #2
    Easy to do. You'll need to split your comment that adds the contents into two. The -linebreak- options puts one or more linebreaks after writing the contents of the expression. The second needs the -append- option to prevent overwriting the contents of the cell.

    Code:
    putdocx table mytable(1,1)=(string(`val1', "%3.1f")), linebreak
    putdocx table mytable(1,1)=("[" + string(`val2', "%3.1f") + "-" + string(`val3', "%3.1f") + "]"), append

    Comment


    • #3
      Thanks it works perfecly. I didn't know we could append into a cell and to be honest I was looking for something more complicated.

      Comment

      Working...
      X