Hi Support team
I am using version 7 to generate document on fly. It will have some pdf pages.
I am adding table on pdf page using Table2 class. Table will have 10000 plus rows. I am checking for table2.HasOverflowRows() and adding new pages in document if I till I will get some value in table2.GetOverflowRows().
I am able to repeat header column of table on each page using RepeatColumnHeaderCount property.
My question is how can I set footer column for table on each page ?
Thanks
Satish
Footer for table
Re: Footer for table
Forum member · May 24, 2012I mean to say how can I add footer row on each page for table ?
Re: Footer for table
Support · May 25, 2012Hello Satish,
The DynamicPDF Generator for .NET product do not have any property or method to set a row as footer to the Table2 page element but you can achieve your requirement by adding another separate table below the main table as footer.
float yPosition;
Document document = new Document();
Table2 table = new Table2(0, 0, 600, 400);
table.Columns.Add(150);
table.Columns.Add(90);
table.RepeatColumnHeaderCount = 1;
Row2 row1 = table.Rows.Add(30);
row1.CellDefault.Align = TextAlign.Left;
row1.CellDefault.VAlign = VAlign.Top;
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
for (int i = 0; i < 100; i++)
{
Row2 row3 = table.Rows.Add(30);
Cell2 cell2 = row3.Cells.Add("text" + (i + 1));
cell2.Align = TextAlign.Left;
cell2.VAlign = VAlign.Top;
cell2.Splittable = true;
Cell2 cell3 = row3.Cells.Add("text" + (i + 1));
cell3.Splittable = true;
}
//Adding table to page.
do
{
Page page = new Page();
float width = table.Width;
float height = table.Height;
document.Pages.Add(page);
page.Elements.Add(table);
//Build Table to add footer.
Table2 footerTable = new Table2(0, 0, 600, 30);
footerTable.Columns.Add(150);
footerTable.Columns.Add(90);
Row2 footerRow = footerTable.Rows.Add(30);
footerRow.CellDefault.Align = TextAlign.Left;
footerRow.CellDefault.VAlign = VAlign.Top;
footerRow.Cells.Add("Footer 1");
footerRow.Cells.Add("Footer 2");
footerTable.Width = width;
footerTable.X = table.X;
if(height > table.GetRequiredHeight())
{
yPosition = (float)(table.Y + table.GetRequiredHeight());
}
else
{
yPosition = (float)(table.Y + table.Height-10);
}
footerTable.Y = yPosition;
page.Elements.Add(footerTable);
page.Elements.Add(new LayoutGrid());
table = table.GetOverflowRows();
} while (table != null);
document.Draw(@"C:\MyDocument.pdf");
Thanks,
ceTe Software Support Team.
Re: Footer for table
Forum member · May 25, 2012It helps a lot.
Thank you for your time.
Satish