Execute Merging the fields with regions

Hi, I have a question on merging the fieds with regions

Hi Smita,


Thanks for the inquiry. Could you please share us some details? We will look into this and guide you accordingly. Moreover, please follow up the appropriate documentation links below:

http://www.aspose.com/docs/display/wordsnet/Mail+Merge+with+Regions+Explained
http://www.aspose.com/docs/display/wordsnet/How+to++Execute+Mail+Merge+with+Regions

I hope, this will help.

Hi ,

I have an issue with merging the fields with regions.

I have placed the merge fields in the word document as below

«TableStart:RejectReasons»

«RejectReason» «TableEnd:RejectReasons»

XML will look like below.. I can able to merge all the other fields except 'Reject Reasons'

- <Root>
- <Main>
<Date>2012-04-27</Date>
<DeliverToName>test345</DeliverToName>
<AddressLineOne>test35345</AddressLineOne>
<AddressLineTwo />
<City>Phoenix</City>
<Country>UNITED STATES</Country>
<CountryId>1280</CountryId>
<InCareOf />
<State>AZ</State>
<Zip>23424</Zip>
<IsUndeliverable>0</IsUndeliverable>
<DocumentTypeDisplayName>Annual Report</DocumentTypeDisplayName>
<AccFileNumber>F3454367</AccFileNumber>
<EntityName>Test Inc.</EntityName>
<AccOrderNumber>3892296</AccOrderNumber>
<ARFilingDueDate>6/19/2012</ARFilingDueDate>
<ReceivedDate>2012-04-25</ReceivedDate>
<DeliveryMethodId>3296</DeliveryMethodId>
<Attention />
</Main>
- <RejectReasons>
<RejectReason>The Certificate of Disclosure Bankruptcy question was not answered. One box must be checked.</RejectReason> </RejectReasons>
<RejectReasons>
<RejectReason>Payment is not made <RejectReason> </RejectReasons>
</Root

In our code behind file:

XElementMailMergeDataSource ds = new XElementMailMergeDataSource(correspondence.DocumentData, "Main");

doc.MailMerge.Execute(ds);

XElementMailMergeDataSource rejectReasons = new XElementMailMergeDataSource(correspondence.DocumentData, "RejectReasons");

doc.MailMerge.ExecuteWithRegions(rejectReasons);

Any help is appreciated.

Thanks!

Hi there,


Thanks for your inquiry.

Could you please attach the code for XElementMailMergeDataSource here as well for testing?

Thanks,

Hi ,

Please find the attached text file which has the code for XElementMailMergerDataSource.

Thanks and appreciate your help!

Hi Smita,

Thanks for the inquiry. Could you please share us input template document? We will take a closer look and guide you accordingly. In addition, I will suggest you to go through the following thread:

I hope, this will help.

Hi,

Please find the attached document template..

Thanks,

Hi Smita,


Thanks for the additional information. Please find required code snippet and input/output documents as an attachment. I hope, this will help. In case of further assistance, please let me know.

Hi ,

Thanks, but I am getting errors with the code snippet , can you please send me the solution file, if you have any for the above code sinppet, so that i can try to run seperately and see it.

Thanks!

Hi,

According to your codesnippet which has 'MyMailMergeDataSource' class, I need to change lot of my code

by using my XElementDataSource class, can you please get the solution for it. And also can you use the Xml which i have attached..

Thanks!

Hi,

Please find the attached zip file, i did the changes to my code according to your sample code that you sent. But still it is not working..

Any help will be appreciated...

Hi Smita,

Please accept my apologies for late response. I am working on your query and will update you asap.

Hi Smita,

Please accept my apologies for your inconvenience.

I have attached the Visual Studio solution of shared code by my colleague Imran. Please execute this application at your side and let us know If you face any issue. I have attached input and output files with this post.

Please modify the attached code as per your requirement and let us know, If you still face problem. We are really keen to help you but need some more feedback from your side.