Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Dec 09, 2021 8:57 am

I see Mailmerge.ExecuteWithNestedRegion used in the samples and demo code, but can't find any docs about it. Specifically I'm wondering how a datatable has to be structured if I have sections in the document and some mergefields are in section #1 and some others in section #2.

gfischer
 
Posts: 7
Joined: Thu Nov 04, 2021 9:34 am

Thu Dec 09, 2021 10:05 am

Hello,

Thanks for your inquiry!

To help us better understand and quickly solve your issue, please provide us with your input file and the output file you expect for reference.

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Thu Dec 09, 2021 10:33 am

To provide an example is a bit complicated because of the actual data used. But maybe I can it explain like that:

What I'm wondering is how a dataset has to be structured when the template contains sections. Based on the sample in https://www.e-iceblue.com/Tutorials/Spi ... eport.html let's assume I add region breaks above and below the customer table, so that my template document has three regions. When I do that in my document I get an exception on ExecuteWithNestedRegion:
Code: Select all
   at System.Collections.Generic.Stack`1.ThrowForEmptyStack()
   at Spire.Doc.Reporting.MailMerge.ᜀ.ᜀ(ICompositeObject A_0, Stack`1 A_1)
   at Spire.Doc.Reporting.MailMerge.ᜀ.ᜀ(ICompositeObject A_0, Stack`1 A_1)
   at Spire.Doc.Reporting.MailMerge.ᜀ.ᜀ(ICompositeObject A_0)
   at Spire.Doc.Reporting.MailMerge.ᜀ.ᜀ(Body A_0, IRowsEnumerator A_1)
   at Spire.Doc.Reporting.MailMerge.ᜀ(Section A_0, IRowsEnumerator A_1)
   at Spire.Doc.Reporting.MailMerge.ᜉ(String A_0)
   at Spire.Doc.Reporting.MailMerge.ExecuteWidthNestedRegion(DataSet dataSet, List`1 commands)
   at ...

So it seems to me that the regions in the document, as the name of the method ExecuteWithNestedRegions somehow suggests. and the data structure in the DataSet have some inter dependency.

gfischer
 
Posts: 7
Joined: Thu Nov 04, 2021 9:34 am

Fri Dec 10, 2021 5:46 am

Hello,

Thanks for sharing more information!

According to the error message you posted, I guess the issue might be related to the data you put in. To help us investigate the issue quickly and efficiently, please provide us with the document which contains merge fields for reference. You can also send it to us via email, we promise to keep your document confidential, and we will not use it for any other purpose. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Jan 04, 2022 5:55 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please provide us with the information I mentioned in the last post for further investigate?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.Doc