PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Subtotal in the table on each page
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2975
Page 1 of 1

Author:  mshak [ Fri Nov 07, 2014 11:41 am ]
Post subject:  Subtotal in the table on each page

Good day.
I use MigraDoc to create PDF documents. The approximate form of the document in the attached image. Please tell me how to add a row with subtotals on every page, because MigraDoc does not know which page it is (That right?). Tried to count rows, but the height of each row variable.

Attachments:
File comment: form of the document
migradoc_problem.png
migradoc_problem.png [ 9.56 KiB | Viewed 8684 times ]

Author:  Thomas Hoevel [ Mon Nov 10, 2014 1:46 pm ]
Post subject:  Re: Subtotal in the table on each page

Hi!
mshak wrote:
Please tell me how to add a row with subtotals on every page, because MigraDoc does not know which page it is (That right?).
MigraDoc was designed to create documents that can be rendered in various output formats. MigraDoc has sections and page breaks, but pages do not exist for MigraDoc.
There is no easy way to get what you want.

What I would try: I'd increase the bottom margin to make space for the summary, render the document with the tables to let the renderer make the page breaks.
Then I'd create a new document with a new table for each page, adding the rows, the summary row, and a page break.

You can use the Tag property to identify your data. You could add the row number as Tag to the first paragraph in the first column of each row.
You can call the GetDocumentObjectsFromPage method supplied by the renderer to find which rows are on which page.

Author:  mshak [ Mon Dec 01, 2014 2:46 pm ]
Post subject:  Re: Subtotal in the table on each page

Thomas Hoevel, thank you very much. This solution works very well.

Author:  jesdegar [ Mon Jan 30, 2023 12:31 pm ]
Post subject:  Re: Subtotal in the table on each page

hi mshak, how you solve this, does each page have the same row of data or maybe different, can you give me some advice. thx

Author:  christophe62 [ Thu Oct 12, 2023 9:40 am ]
Post subject:  Re: Subtotal in the table on each page

I'm also curious about the solution. Do you have an example to show?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/