我们正在使用DynamicPDF写出一个表,但是我们希望对行进行“分组”,这样就不会在组的中间出现分页符。这些组在1到6行之间。有没有人找到了这样做的方法?下面是我们的代码:
// Create a PDF Document
Document document = new Document();
Table2 table = new Table2(0, 0, 200, 700);
// Add columns to the table
table.Columns.Add(100);
table.Columns.Add(100);
// This loop populates the table
for (int i = 1; i <= 400; i++)
{
Row2 row = table.Rows.Add(20);
row.Cells.Add("Row #" + i);
row.Cells.Add("Item");
}
// This loop outputs the table to as many pages as is required
do
{
Page page = new Page();
document.Pages.Add(page);
page.Elements.Add(table);
table = table.GetOverflowRows();
} while (table != null);发布于 2019-02-07 01:42:37
没有直接完成此操作的属性或方法,但您可以按如下方式完成此操作:
请记住,如果将Table2.RepeatRowHeaderCount属性设置为> 0,则需要将这些标题行包括在每个溢出表的计算中(上面的#2)。
完全公开,我为DynamicPDF的制造商ceTe软件工作。
https://stackoverflow.com/questions/54540763
复制相似问题