Custom Reports: Changing how empty fields are handled

When exporting a custom report document, there is special handling for table rows and ranges that contain empty merge fields. This can sometimes have unintended side effects, especially in tables that have fields across multiple columns, or tables with merged cells. 

The default behavior is:

  • If a table row contains merge fields, but none of the fields had values after merging, the table row is automatically removed.
  • If a «RangeStart:...» range contains merge fields, but none of the fields had values after merging, the entire range is automatically removed.

You can change the default behavior by adding a custom property to your document before uploading it to Valcre. 

  1. Open the custom report in Microsoft Word.
  2. Open the File menu in the top left corner.
  3. Click Info in the left bar.
  4. Click the Properties dropdown on the right side of the screen, and click Advanced Properties.mceclip1.png
  5. In the Properties window, select the Custom tab.
  6. In the Name: field, enter "MailMerge.ClearOptions".
  7. In the Value: field, enter one of these options:
    • "None": Nothing will be automatically be removed. Empty fields will appear blank.
    • "RemoveUnusedFields": Remove fields for which no data has been found in the mail merge data source.
    • "RemoveEmptyRanges" Remove «RangeStart:...» ranges into which no field has been merged.
    • "RemoveEmptyParagraphs": Remove paragraphs which contained merge fields but none of them has been merged.
    • "RemoveEmptyTableRows": Remove table rows which contained merge fields but none of them has been merged.
    • You can also specify multiple options separated by commas, for example "RemoveEmptyRanges,RemoveEmptyTableRows".
  8. Click the Add button and then the OK button.

mceclip0.png

If you need to change the setting later, select the "MailMerge.ClearOption" item from the Properties: list, change the Value: field, click the Modify button, and then click the OK button.

Was this article helpful?
0 out of 0 found this helpful