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

Free Support Forum - aspose.com

Mailmerge with template row

Hi

I have a problem in using a template Row with MergeFields for creating new rows in my destination document. If i do a MailMerge.Execute() for Each Imported Row-Node there is only 1 Row in my document at the end. Please see attachments. There is a small test-app and the src-doc.

I don’t want to use MailMerge.ExecuteWithRegions() because i need additional Rows at the end of the table (for example a summary) if i have more than one document and also on the next page.

Thanks in advance.

Norbert

Hi Norbert,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I am not sure why you refused using Mail Merge with Regions. As I can see this approach perfectly fit your requirements. If you need to add summary row, you can add it in the template. Then just put summary result into this row.

Best regards,

Hi Alexey,

thank you for your reply. But that is not exactly what i need. ;o)

I need an additional row on each page with a summary (subtotal) for all rows in the table including the actual page. But only if the table is longer than 1 page and not on the last page. This row should appear also on the next page (after the head row) where the table continues. On the first Page I need additional Information at the Top of the Page. On the last page I need additional Summary Rows at the end (like tax etc.).

Is this possible with aspose.words? Can I use a template for this? What's the best product to create such documents?

Best regards,

Norbert

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Using Aspose.Words you cannot determine where page starts or ends. This makes it hard to insert subtotal row at the end of each page.

However, If you know number of rows that should be placed on the page, you can achieve this using the same approach as suggested here:

http://www.aspose.com/community/forums/263635/aspose.words.dll-execute-region-no.of-rows-in-a-page/showthread.aspx#263635

Small modification of this approach will allow you inserting subtotal row at the end of each page.

Please let me know if such approach is acceptable for you. I will be glad to assist you further.

Best regards,

Hey Alexey,

no, I don't know how much rows fit on one page because of different text length in the columns, header, footer, etc. So each rows height could be different. All Texts should be filled dynamically - the header, the footer, etc. If the Header is bigger because of a longer text there is less space in the body.

Hmm.... there must be a solution for this ...

I have found this to determine on which page my row-node is. Hmm...

https://forum.aspose.com/t/65265

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />Best regards,

Norbert

Hi Norbert,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Yes, solution suggested by Adam might work for you. However, it will require updating page layout each time when you insert new row. I would like to say that updating page layout is time-consuming operation. So such approach probably will slow down document generation process.

Best regards,