We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word- Merging of Header & Footers

Hi Folks,

I am having a few problems and hope that you might be able to assist.

I have created a Word Document with mail merge, however I am having a problem doing the following. What we have created is an invoice and I am testing this over multiple pages.

When I copy the merge fields to the header or footer it does not show the data, just the merge field names. I have tried a number of times changing the data that is to be shown to no avail.

What I am looking to do is;

Create Headers & Footers. First page would have a 'continued…" in the footer, and the final page would have the ‘receipt’ piece.

Obviously the header would include the invoicee.

Please let me know if you need anymore information, this one has me stumped.

Hi

Thanks for your inquiry. Could you please attach sample template and code you use to fill it with data? I will try to reproduce the problem and provide you more information.

Best regards.

Thanks Alexey.

I can give you a copy of the invoice no problems there. However the data we get is from a SQL Database on .NET. I would need to have an account setup through our servers so you could see this in action. Otherwise we can extra the data to an Excel Spreadsheet.

Hi Jason,

Actually, I do not need real data you insert into the document. You can create simple code, which uses dummy data. For example, DataTable of DataSet, which are created on the fly. For start, it would be enough if you attach only simple template.

Best regards.

Thanks Alexey. I will send those over to you now. Which e-mail address can I send those to?

Thanks
Jason

Hi

Thanks for your request. You can send e-mail via our site. Please send the files to my e-mail, as described here:

http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

Best regards.

Hi Alexey,

I have e-mailed you off the require files. Please get back to me if you require anymore information.

Many thanks.

Hi Jason,

Thank you for additional information. The problem occurs because your template is no very well designed. You have mail merge regions which starts in Header and ends in the main story. It is not allowed. Using TableStart and TableEnd merge fields you mark part of content, which is supposed to be repeated. But, when you have TableStart and TableEnd in different stories it is not clear which part of content you would like to repeat.

Also, I do not think, that you need regions in your header and footers because usually headers and footers are repeated on each page and if table in your header/footer will grow, it will push content on each page down. In this case, result will not be very good.

I suppose, what you need to achieve is parent-child relationships in your document. Is that right? You need the following structure of the output document:

TransactionHeader 1

TransactionDetail 1

TransactionDetail 2

……

TransactionDetail N

TransactionHeader 2

TransactionDetail 1

TransactionDetail 2

……

TransactionDetail N

……………

TransactionHeader N

TransactionDetail 1

TransactionDetail 2

……

TransactionDetail n

TransactionHeaderTotals

Is that right? If so, I think, you can use the same technique as shown in Product Catalog demo.

http://www.aspose.com/demos/.net-components/aspose.words/csharp/general/product-catalog.aspx

Unfortunately, there is no direct way to populate document with data with parent-child relationships. This feature will be supported later. I will notify you.

If I am not right in my description. Please clarify what the expected output is.

Best regards.

The issues you have found earlier (filed as 39) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(35)

We are happy to tell you that the new version of Aspose.Words, which we have just released, supports mail merge with nested regions. You can download the latest version of Aspose.Words from here:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx.