However, since the Master area is not repeating, I took out the TableStart:Master/TableEnd:Master fields and changed that to use Execute. But then the Details table does not get filled in.
Hi
Thank you for your inquiry. Could you please explain me what you are trying to achieve? Also please attach your template document and document that will show me the result that you need to get.
If you put DataReader into the Execute method whole section will be repeated for each record in your reader.
Best regards.
Dim reader As SqlDataReader = cmd.ExecuteReader()
doc.MailMerge.ExecuteWithRegions(reader, "Project")
reader.NextResult()
doc.MailMerge.ExecuteWithRegions(reader, "Recommendations")
reader.NextResult()
doc.MailMerge.Execute(reader)
My only problem was that when I use Execute(reader) for the first section as it is not a repeating section, there was never any data in other sections. Yet using Start/End table it works fine.
The stored proc returns 3 result sets: one header row, then detail rows, then a footer row.
Hi
Thank you for additional information. I think that this occurs because ExecuteWithRegions method fills only one region in the document. But if you run Execute method first there could be several regions with same name (I mean TableStart/End:name). In this case only first region will be filled with data. So you should run ExecuteWithRegions and then run Execute method.
Best regards.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.