i want repeated the first three row for header at page break, but it shows like a bug
123.jpg (64.8 KB)
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Aspose.Pdf.Page page = doc.Pages.Add();
Aspose.Pdf.Table tab = new Aspose.Pdf.Table();
page.Paragraphs.Add(tab);
tab.DefaultCellTextState.Font = FontRepository.FindFont("DFKai-SB");
tab.DefaultCellTextState.FontSize = 12;
tab.DefaultCellTextState.HorizontalAlignment = HorizontalAlignment.Center;
if (Affair.AffairClass == "業務")
{
tab.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F);
tab.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F);
tab.ColumnWidths = "100 100 50 100 35 35 35 35";
Aspose.Pdf.Row row1 = tab.Rows.Add();
row1.Cells.Add("關鍵策略目標").RowSpan = 3;
row1.Cells.Add("關鍵績效指標").ColSpan = 7;
row1.MinRowHeight = 20;
row1.IsRowBroken = false;
Aspose.Pdf.Row row2 = tab.Rows.Add();
row2.Cells.Add("關鍵績效指標").RowSpan = 2;
row2.Cells.Add("評估方式").RowSpan = 2;
row2.Cells.Add("衡量標準").RowSpan = 2;
row2.Cells.Add("年度目標值").ColSpan = 4;
row2.MinRowHeight = 20;
row2.IsRowBroken = false;
Aspose.Pdf.Row row3 = tab.Rows.Add();
row3.Cells.Add(Affair.YearStart.ToString());
row3.Cells.Add((Affair.YearStart + 1).ToString());
row3.Cells.Add((Affair.YearStart + 2).ToString());
row3.Cells.Add((Affair.YearStart + 3).ToString());
row3.MinRowHeight = 20;
row3.IsRowBroken = false;
for(int x=0 ; i<200 ; i++)
{
Aspose.Pdf.Row row5 = tab.Rows.Add();
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.Cells.Add("1");
row5.IsRowBroken = false;
}
tab.RepeatingRowsCount = 3;