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

Free Support Forum - aspose.com

Mailmerge Bill with sum on each page footer and general total on last page

Hi,

I need to create a pattern to generate Bills.

I create 300 to 500 bills on each Mailmerge.

A bill has header, product rows (1 to 500 rows), a footer with page total and general total on last page.

Bill can have 1 to 5 pages.

Header and footer must be on each page.

Datas are in sql server database but i can use custom object to define exactly fields and format.

Bill is made of 30 fields and a row collection witch contains 6 fields.



Have you any sample to do this ?

I founded examples for nested mailmerge.

Problem is essentialy for footer automaticly repeated on each page with page sum and total sum on last page. It needs If fields.

If i put it in footer, it’s the same on each page.

If i put it on bottom page, it is only on last page.



Is it possible with aspose Words and Can you help me ?

Regards

Hi there,

Thanks for your inquiry. To repeat header row at the top of each page, please turn on the option 'Repeat as header row at the top of each page' for first row of table. You enable/disable this option using RowFormat.HeadingFormat property.

To add sum of numbers of specific column for each page, we suggest you following solution.

1) After mail merge, please iterate through all rows of table and sum the cell's contents (numbered value).
2) You can get the page index of row using LayoutCollector.GetStartPageIndex. This method returns 1-based index of the page where node begins.
3) Add a text box at the bottom of each page and insert sum value of specific column.

Hope this helps you. Please let us know if you have any more queries.