[英]DynamicPDF table: is there a way to group rows?
我们正在用DynamicPDF编写一个表,但是我们想对行进行“分组”,这样在分组的中间不会出现分页符。 这些组从一到六行不等。 有没有人找到一种方法来做到这一点? 这是我们的代码:
// 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);
没有直接执行此操作的属性或方法,但是您可以按照以下步骤实现:
请记住,如果您将Table2.RepeatRowHeaderCount属性设置为> 0,则需要在计算中为每个溢出表包括这些标头行(上面的#2)。
完全公开,我为DynamicPDF的制造商ceTe Software工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.