- Home
- Forum
- ASP.NET MVC - EJ 2
- DocIO 3 levels in ExecuteNestedGroups
DocIO 3 levels in ExecuteNestedGroups
Hi,
I have a list of objects, the models looks like this: public class Location
{
public Guid Id { get; set; }
public string Name { get; set; }
public List<Form> Forms { get; set; }
}
public class Form
{
public Guid Id { get; set; }
public string Name { get; set; }
public List<Question> Questions{ get; set; }
}
public class Question
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Answer { get; set; }
}
And in my document, I want to use MailMerge ExcuteNestedGroups to replace these values, the document looks like this


This is how I execute the merge
But I get the following error, this error only happens using 3 levels, if I remove the Questions table, it works
pItemIndex is less than 0 or greater than 1 (Parameter 'pItemIndex')
pItemIndex is less than 0 or greater than 1 (Parameter 'pItemIndex')
This is the trace
at Syncfusion.DocIO.DLS.TextBodyPart.ValidateArgs()
at Syncfusion.DocIO.DLS.TextBodyPart.PasteAt(ITextBody textBody, Int32 itemIndex, Int32 pItemIndex, Boolean isBkmkReplace)
at Syncfusion.DocIO.DLS.MailMerge.OnBodyGroupFound(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.FindInBodyItemsInNested(BodyItemCollection bodyItems, Int32 itemStart, Int32 itemEnd)
at Syncfusion.DocIO.DLS.MailMerge.ExecuteGroupForSelection(WTextBody textBody, Int32 itemStart, Int32 itemEnd, Int32 pItemStart, Int32 pItemEnd, IRowsEnumerator rowsEnum)
at Syncfusion.DocIO.DLS.MailMerge.OnBodyGroupFound(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.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 Building.Api.Controllers.ReportsController.DownloadFacilityAssessment(Guid propertyId) in C:\Users\larah\source\repos\axis\BuildingSolutions\Building.Api\Controllers\ReportsController.cs:line 375
SIGN IN To post a reply.
2 Replies
1 reply marked as answer
LB
Lokesh Baskar
Syncfusion Team
April 8, 2021 12:14 AM UTC
Hi Hugo,
Thank you for contacting Syncfusion support
We are currently checking on your query to replicate the same problem by creating a similar case of document at our end. We will update you the details on 8th April 2021.
Please let us know if you have any other questions.
Regards,
Regards,
Lokesh B
LB
Lokesh Baskar
Syncfusion Team
April 8, 2021 05:07 PM UTC
Hi Hugo,
Thank you for your patience.
We tried to reproduce the reported problem while executing the nested mail merge group error but, it works properly at our end. For your reference, we have attached the sample application which we used to reproduce the reported issue and it can be downloaded from the below link:
Please find the input and output Word document which generated at our end from the below link:
We suspect that the reported issue might be due to file level information in the Word document. So, could you please share us the below things at your end:
1. Modified sample of above along with the exact input Word document.
2. Screenshot of the issue/Output Word document which generated at your end
3. Syncfusion product version which you are using in your application.
4. Input Word documents which used at your end.
This will be more helpful to reproduce the same issue at our end. Thereby, we will proceed further on the reported issue and provide you the appropriate solution at the earliest.
Please let us know if you have any other questions.
Regards,
Lokesh B
Marked as answer
SIGN IN To post a reply.
- 2 Replies
- 2 Participants
- Marked answer
-
HL Hugo Lara
- Apr 5, 2021 06:32 PM UTC
- Apr 8, 2021 05:07 PM UTC