I'm using C# to create a FlowDocument and fill it with data within a table.
Example:
FlowDocument flowDoc = new FlowDocument();
Table table1 = new Table();
flowDoc.Blocks.Add(table1);
table1.RowGroups.Add(new TableRowGroup());
table1.RowGroups[0].Rows.Add(new TableRow());
TableRow currentRow = table1.RowGroups[0].Rows[0];
table1.RowGroups[0].Rows.Add(new TableRow());
currentRow = table1.RowGroups[0].Rows[0];
currentRow.Cells.Add(new TableCell(new Paragraph(new Run("Report"))));
I want to be able to force a page break after every 'section' of data. I have found the BreakPageBefore but cant figure out how to force a Page Break.
Any examples would be fantastic!
Thanks.
If I understand right you want to do this:
Section section = new Section();
section.BreakPageBefore = true;
section.Blocks.Add(table1);
flowDoc.Blocks.Add(section);
If you want to break within a table i suggest it would be better to make a new table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With