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

Free Support Forum - aspose.com

Summary Total row

We have a requirement where if a table overflows to the next page in a word document, we want to add a summary total row at the top of the table on the next page. ( Summary row will have the total of the data in the above column of the previous page). Can we know if it is supported by aspose and if yes, how we can achieve this.

Thank you,
Sindhu Madakasira.


Could you please ZIP and attach your input and expected output Word documents here for our reference? We will then provide you more information about your query.

Hi @tahir.manzoor,
Sorry for the late reply. Please check the documents I have added here. They have an input XML and input template and the expected output file.
TestDocuments.zip (71.2 KB)


In your case, we suggest you following solution.

  1. Iterate over table rows.
  2. Get the page number of row using LayoutCollector.GetStartPageIndex.
  3. When page number of row is changed, get the table row, clone it and insert it before current row.
  4. Insert the SumAbove field into the table’s cell.

Hope this helps you.

I have manage to add a row in the top of the table in next page. but to add the row in the bottom of the table in that page it is not working. Do you have any idea for it


You can clone the last row of table and add it to table row collection. Once row is added, remove the content of row and insert your desired content. If you still face problem, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.


You are replacing the text enclosed in angle brackets and adding rows to table. We suggest you please use LINQ Reporting engine to achieve your requirement. You need to update your template document according to LINQ Reporting template syntax. To insert Total/Sum of numbers, you can use variable as suggested here: