Custom Reports: Handling Empty Merge Fields in Custom Reports

When exporting a custom report document, table rows and ranges containing empty merge fields are automatically handled by default. However, this can sometimes cause unintended side effects, especially in tables with multiple columns or merged cells.

 

Default Behavior

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

Customizing Merge Field Handling

To change the default behavior, add a custom property to your document before uploading it to Valcre.

Steps to Modify Merge Field Behavior

  1. Open the custom report in Microsoft Word.
  2. Open the File menu in the top left corner.
  3. Select Info in the left bar.
  4. Select the Properties dropdown on the right side of the screen, then select Advanced Properties.
    mceclip1.png
  5. In the Properties window, go to the Custom tab.
  6. In the Name field, enter MailMerge.ClearOptions.
  7. In the Value field, enter one of the following options:
    • None – Nothing is automatically removed. Empty fields will appear blank.
    • RemoveUnusedFields – Removes fields with no data in the mail merge source.
    • RemoveEmptyRanges – Removes RangeStart:... ranges with no merged fields.
    • RemoveEmptyParagraphs – Removes paragraphs containing merge fields with no merged data.
    • RemoveEmptyTableRows – Removes table rows containing merge fields with no merged data.
  8. To specify multiple options, separate them with commas (e.g., RemoveEmptyRanges,RemoveEmptyTableRows).
  9. Select Add, then select OK.

mceclip0.png

Updating the Setting Later

  1. Follow steps 1-5 above to open the Advanced Properties window.
  2. In the Properties list, select MailMerge.ClearOptions.
  3. Change the Value field to your new preference.
  4. Select Modify, then select OK.

💡 Tip: If unexpected formatting issues occur after merging, try using None as the value to keep all fields visible for troubleshooting.

 

For additional questions please contact Valcre Support.

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