Free Support Forum - aspose.com

Summary Total row

Hi,
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.

@sindhuV

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)

@sindhuV

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.