Hello,
I am trying to add a table to start on every page before flowdocument starts to print or as a header. I have put the code of the table below.
Please help. All I want to do is to put this table when a page begins on each page. Please help with a Paginator which includes this table as a header please or an example.
Thank you in advance.
Table table2 = new Table();
table2.FontFamily = new System.Windows.Media.FontFamily("Arial");
table2.CellSpacing = 0;
// table1.Padding = ;
table2.BorderBrush = System.Windows.Media.Brushes.LightGray;
table2.BorderThickness = new Thickness(0, 0.5, 0, 0.5);
int numberOfColumnvs = 9;
for (int x = 0; x < numberOfColumnvs; x++)
{
table2.Columns.Add(new TableColumn());
table2.Columns.Add(new TableColumn() { Width = GridLength.Auto });
}
// Create and add an empty TableRowGroup to hold the table's Rows.
table2.RowGroups.Add(new TableRowGroup());
// Add the first (title) row.
//table1.RowGroups[0].Rows.Add(new TableRow());
// Alias the current working row for easy reference.
table2.RowGroups[0].Rows.Add(new TableRow());
TableRow currentRow2 = table2.RowGroups[0].Rows[0];
int t2df = (from b in conn.tblReQResults
where b.ResultID == GlobalVariables.ResultID && b.Result != "" && b.tblTestPram.tblSubTest.tblPanel.tblCategory.CatID
== ynb.CatID
select b).Count();
if (t2df != 0)
{
table2.RowGroups[0].Rows.Add(new TableRow());
currentRow2 = table2.RowGroups[0].Rows[0];
currentRow2.Cells.Add(new TableCell(new Paragraph(new Run(ynb.Category))));
currentRow2.Cells[0].TextAlignment = TextAlignment.Center;
currentRow2.Cells[0].FontSize = 12;
currentRow2.Cells[0].FontWeight = System.Windows.FontWeights.Bold;
currentRow2.Cells[0].BorderThickness = new Thickness(0, 0, 0, 0.5);
currentRow2.Cells[0].BorderBrush = System.Windows.Media.Brushes.LightGray;
currentRow2.Cells[0].ColumnSpan = 9;
conn = new AtaLIMSDataContext();
section.Blocks.Add(table2);
}