Removing blank spaces in freemarker docx template

Hi,
I am looking for help to remove the blank spaces highlighted in yellow in the attached jpg in freemarker docx template

Please let me know if anybody has done this bfore?

I tried using [#compress] [/#compress] but it didnt help.

freemarker.org/.../dgui_misc_whitespace.html

Thanks
Naveen

OriginalPostID-261169



  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi,

    I have worked on similar requirement to eliminate blank rows in any table in freemarker docx template. Please find example below.

    If Field1 & Field2 are empty, the first line will not be displayed as empty line instead Field3,Field4 row gets displayed.

    Table1

    «[#if doc.mainCdt.subCdt.field1?trim!='' && doc.mainCdt.subCdt.field2?trim!='']»«[#t]»

    Field1

    «${doc.mainCdt.subCdt.field1}»

    Field2

    «${doc.mainCdt.subCdt.field2}»

    «[#t]»«[/#if]» «[#t]» «[#if doc.mainCdt.subCdt.field3?trim!='' && doc.mainCdt.subCdt.field2?trim!='']»«[#t]»

    Field3

    «${doc.mainCdt.subCdt.field3}»

    Field4

    «${doc.mainCdt.subCdt.field4}»

    «[#t]»«[/#if]» «[#t]»

    Thanks,

    KrishnaVeni T 

Reply
  • 0
    Certified Senior Developer

    Hi,

    I have worked on similar requirement to eliminate blank rows in any table in freemarker docx template. Please find example below.

    If Field1 & Field2 are empty, the first line will not be displayed as empty line instead Field3,Field4 row gets displayed.

    Table1

    «[#if doc.mainCdt.subCdt.field1?trim!='' && doc.mainCdt.subCdt.field2?trim!='']»«[#t]»

    Field1

    «${doc.mainCdt.subCdt.field1}»

    Field2

    «${doc.mainCdt.subCdt.field2}»

    «[#t]»«[/#if]» «[#t]» «[#if doc.mainCdt.subCdt.field3?trim!='' && doc.mainCdt.subCdt.field2?trim!='']»«[#t]»

    Field3

    «${doc.mainCdt.subCdt.field3}»

    Field4

    «${doc.mainCdt.subCdt.field4}»

    «[#t]»«[/#if]» «[#t]»

    Thanks,

    KrishnaVeni T 

Children
No Data