Free Support Forum - aspose.com

Empty(Null) Merge Field value

Hi,

I wonder how can I skip the Merge Field to be rendered in case the value is null (or empty String).
What I do currently during in my IMailMergeDataSource implementation once I get the empty result I replace it with empty String, e.g “”. But this sort of work around changes the desired layout of the document by introducing undesired empty areas/lines.

I am using Java version.

Please advise.
Thanks
Michael

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think, in your case, you can try using MailMerge.RemoveEmptyParagraphs option to remove empty paragraphs during mail merge process. See the following link for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/aspose.words.reporting.mailmerge.removeemptyparagraphs.html

Please let me know if you need more assistance, I will be glad to help you.

Best regards,