Eliminate empty spaces where variable value is empty in the document

Hi all,
I am trying to generate a document where I need to place in new line some text in word document also I need to eliminate empty spaces generated when any variable value is empty . I tied both docx to dynamic temmplate as well as  MS word 2007 from template smart services but both seems like not working. Any solution would be really helpful.
Thanks in Advance.

  Discussion posts and replies are publicly visible