Example 7. Inserting page breaks |
Top Previous Next |
Using the "PageBreak" method of the "Table" object, you can insert a page break when printing a table. Call it before you print a row/column.
We will use the Example 1 to demonstrate how the "PageBreak" method works. Let us print the third row on a new page.
private void Table1_ManualBuild(object sender, EventArgs e) { // print the row 0 with all its columns Table1.PrintRow(0); Table1.PrintColumns();
// print the row 1 with all its columns Table1.PrintRow(1); Table1.PrintColumns();
// insert page break before the row 2 Table1.PageBreak();
// print the row 2 with all its columns Table1.PrintRow(2); Table1.PrintColumns(); }
As a result, we get the following:
|