During mail merge a exception is thrown when only a nested table is inside it's parent table cell.
Inside IsRemainingParaHasRemoveEmpty it tries to cast the WTable to WParagraph which fails:
foreach (WParagraph childEntity in (CollectionImpl) parentCell.ChildEntities)
With following exception:
Unable to cast object of type 'Syncfusion.DocIO.DLS.WTable' to type 'Syncfusion.DocIO.DLS.WParagraph'.
at Syncfusion.DocIO.DLS.MailMerge.IsRemainingParaHasRemoveEmpty(WTableCell parentCell)
at Syncfusion.DocIO.DLS.MailMerge.ExecuteGroupForSelection(WTextBody textBody, Int32 itemStart, Int32 itemEnd, Int32 pItemStart, Int32 pItemEnd, IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.ExecuteGroupForRowSelection(WTable table, Int32 startRowIndex, Int32 count, IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.OnRowGroupFound(IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.OnGroupFound(IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.GroupSelector.CheckItem(ParagraphItem item)
at Syncfusion.DocIO.DLS.MailMerge.GroupSelector.FindInBodyItems(BodyItemCollection bodyItems)
at Syncfusion.DocIO.DLS.MailMerge.GroupSelector.FindInTable(WTable table, Int32 startRow, Int32 endRow)
at Syncfusion.DocIO.DLS.MailMerge.GroupSelector.FindInBodyItems(BodyItemCollection bodyItems)
at Syncfusion.DocIO.DLS.MailMerge.GroupSelector.ProcessGroups(WTextBody body, IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.ExecuteGroup(WSection section, IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.ExecuteNestedGroup(String tableName)
at Syncfusion.DocIO.DLS.MailMerge.ExecuteNestedGroup(MailMergeDataTable dataTable)
at Program.<Main>$(String[] args) in ...\ConsoleApp1\Program.cs:line 27
No exception is thrown when RemoveEmptyParagraphs is disabled.
Attached is small console app code and document which should help verify the issue with latest version "23.2.5" of:
Syncfusion.DocIORenderer.Net.Core