We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Nested Mail Merge Group not working

Hi Support,

I have a table course data and schedule data. a course can have more than one data. I want to make a document that have a table of schedules from the chosen course. Let's say course X has 3 schedules A,B,C. the template is
<>
Course Id : <>
Course Name : <>

| Schedule Id | Schedule Name |
<>
|<>|<>|
<>

<>

I'm using document.MailMerge.ExecuteNestedGroup(dataset, command)
the dataset has 2 tables
- schedule
- scheduleList

the schedule table has 2 columns
- courseId
- courseName

the scheduleList table has 3 columns
- scheduleId
- scheduleName
- courseId

the commands are (i'm using VB.NET)
New DictionaryEntry("Schedule", String.Empty)
New DictionaryEntry("ScheduleList", "courseId = Decimal.Remainder( , Schedule.courseId )%")

The result is
Course Id : 1
Course Name : X

| Schedule Id | Schedule Name |
<>
| | |
<>

the schedule group works perfectly. but the data in scheduleList group doesn't. Am i missing something here?

attached is the screenshot of my data, mail merge template, and the result.



Thanks
Karina



Training Schedule_8d9cfac0.zip

14 Replies

TA Tasha October 25, 2011 09:52 AM UTC

Hi again... seems like double << is not allowed.. so i fixed it

Hi Support,

I have a table course data and schedule data. a course can have more than one data. I want to make a document that have a table of schedules from the chosen course. Let's say course X has 3 schedules A,B,C. the template is
-BeginGroup:Schedule-
Course Id : -courseId-
Course Name : -courseName-

| Schedule Id | Schedule Name |
-BeginGroup:ScheduleList-
|-scheduleId- |-scheduleName- |
-EndGroup:ScheduleList-

-EndGroup:Schedule-

I'm using document.MailMerge.ExecuteNestedGroup(dataset, command)
the dataset has 2 tables
- schedule
- scheduleList

the schedule table has 2 columns
- courseId
- courseName

the scheduleList table has 3 columns
- scheduleId
- scheduleName
- courseId

the commands are (i'm using VB.NET)
New DictionaryEntry("Schedule", String.Empty)
New DictionaryEntry("ScheduleList", "courseId = Decimal.Remainder( , Schedule.courseId )%")

The result is
Course Id : 1
Course Name : X

| Schedule Id | Schedule Name |
-BeginGroup:ScheduleList-
| | |
-EndGroup:ScheduleList-

the schedule group works perfectly. but the data in scheduleList group doesn't. Am i missing something here?

attached is the screenshot of my data, mail merge template, and the result.



Thanks
Karina




GT Gunasekaran T Syncfusion Team October 28, 2011 06:45 AM UTC

Hi Karina,

Thank you for your interest in Syncfusion products.

We have created a sample to illustrate your requirement to perform nested mail merge using DocIO. We have attached the sample for your reference; please do find the sample from the attachment. Try the attached sample and let us know if this helps you.

Could you please provide us the sample along with input template document to reproduce the mentioned issue with nested mail merge on our side for further analysis?

Please let us know if you have any other questions.

Regards,
Gunasekaran



Sample_da30be06.zip


TA Tasha October 28, 2011 10:03 AM UTC

Hi Support,

Thank you so much for your sample.
Unfortunately, I'm using data table instead of database connection.
My sample code is attached.

Karina Tasha




SampleDocIO_8897d074.zip


PR Poornima R Syncfusion Team November 2, 2011 04:40 AM UTC

Hi Karina,

Thank you for your update.

We have modified your sample to perform nested mail merge on the given template document. Please find the sample from the below link. Try running the sample and let us know if this helps you.

Sample:
SampleDocIO1154440786.zip

If you face any issues, please provide us with the following details for further investigating

1) Provide us with the clear information about the issue from your side
2) Provide us with the screen shot of the issues and the generated output word document
3) Provide us with the sample to reproduce the issue



Please let us know if you have any questions.

Regards,
Poornima




TA Tasha November 2, 2011 07:14 AM UTC

Hi Support

just tried it and it works!!!

thank you so much

Karina



PR Poornima R Syncfusion Team November 3, 2011 06:24 AM UTC

Hi Karina,

Thank you for your update.

Please let us know if you have any other questions.

Regards,
Poornima




TA Tasha January 3, 2012 06:13 PM UTC

Hi Support

so i tried the last sample you gave me and it worked.

i made some changes and i got this error message
Group 'Training_Schedule_List' is missing in the source document

attached is the template i use.

i used the code from your sample project.

any advice?





Training Schedule_905b0c5b.zip


PR Poornima R Syncfusion Team January 5, 2012 11:31 AM UTC

Hi Karina,

Thank you for your update.

For your requirement of performing nested mail merge within the table, please try using the group name as “TableStart” and “TableEnd” instead of “BeginGroup” and “EndGroup” respectively. We have prepared the modified document for your requirement. Please find the document from the below link. Try using the document and let us know whether the issue is resolved.

Modified document:
Training Schedule_Modified1324517736.zip

Please refer the below link for more information about nested mail merging

http://help.syncfusion.com/ug_94/Reporting/DocIO/ASP.NET/default.htm?turl=Documents%2F461nestedmailmerge.htm

Please let us know if you have any questions.

Regards,
Poornima






GT Gunasekaran T Syncfusion Team January 6, 2012 01:01 PM UTC

Hi Karina,

Thank you for your update.

In the provided template document the group start and end for a table is preserved as BeginGroup and EndGroup respectively, which causes the mentioned exception. Nested mail merge in a region works when the group start and end is BeginGroup and EndGroup respectively. Nested mail merge in a table works when the group start and end is TableStart and TableEnd respectively. We have modified your template document to overcome the mentioned exception while mail merging using DocIO. Please do find the modified template document from the attachment.

We have recently fixed an issue with populated data within table during nested mail merge. While performing mail merge with the modified template, merge fields in the table group will be preserved empty. Could you please report this issue through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let us know if you have any questions.

Regards,
Gunasekaran




ModifiedDocument_9c65af08.zip


TA Tasha January 7, 2012 05:10 PM UTC

Hi Support

I'm a little bit confused.
the last sample you gave me 'SampleDocIO1154440786.zip' worked well using BeginGroup-EndGroup for the table and suddenly it didn't work (got the missing source exception). i didn't change the code. any idea the reason this error message occurs?

i tried to change it using TableStart-TableEnd, the document is created but the table is empty. Why is that?

i just report this issue to support. Hope they will respond it :)

Karina Tasha



TA Tasha January 8, 2012 09:25 AM UTC

Hi Support,

I did some changes on the template and it's working now.
Thank you so much for your help.

Anyway, another question is, i'm using MailMerge.RemoveEmptyParagraphs method on print to word feature and it works perfectly.
My question is, how to use it if i want to print the document to pdf?
My code:

Dim document As New WordDocument
document = New WordDocument("..\x.doc")
document.MailMerge.RemoveEmptyParagraphs = True
document.MailMerge.ExecuteNestedGroup(SetPrintTable(), SetPrintCommand())
document.Save("x.doc")

Dim converter As DocToPDFConverter = New DocToPDFConverter()
Dim pdfDoc As PdfDocument = converter.ConvertToPDF(document)

i still able to see the empty paragraph.
attached are the word template file, the file result in word format, and the file result in pdf format.

Any advice?

Karina Tasha



Training_Schedule_List_a6f6ee5d.zip


PR Poornima R Syncfusion Team January 9, 2012 06:13 AM UTC

Hi Karina,

Thank you for your update.

We could able to reproduce the mentioned issue with the “Preservation of empty paragraph in the converted Pdf even after setting MailMerge.RemoveEmpty paragraph as true value.”. Could you please report this issue through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents ), because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well? Please ignore if you have already reported this issue.

As a work around, please try converting the saved word document (x.doc) into pdf instead of converting document object into Pdf and let us know whether the mentioned issue is resolved.

Modified code snippet:
Dim document As New WordDocument
document = New WordDocument("..\x.doc")
document.MailMerge.RemoveEmptyParagraphs = True
document.MailMerge.ExecuteNestedGroup(SetPrintTable(), SetPrintCommand())
document.Save("x.doc")

Dim converter As DocToPDFConverter = New DocToPDFConverter()
Dim pdfDoc As PdfDocument = converter.ConvertToPDF("x.doc")

Please find the sample from the below link illustrating the same. Try running the sample and let us know if this helps you.
Sample:
SampleDocIO-572680974.zip

Please let us know if you have any questions.

Regards,
Poornima




TA Tasha January 13, 2012 09:57 AM UTC

Hi Support

thanks for the update.. it works perfectly!!!

Karina Tasha



PR Poornima R Syncfusion Team January 16, 2012 03:53 AM UTC

Hi Karina,

Thank you for your update.

Please let us know if you have any other questions.

Regards,
Poornima



Loader.
Live Chat Icon For mobile
Up arrow icon