[英]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.