Hello,
I am referring the article below to create table from datatable. My data goes over 100 pages. How can I show the header row in each page from the code mentioned below. Also how do I mentioned my own header names instead of the ones getting from Datatable
Thanks
@kshah05
table.FirstRow.RowFormat.HeadingFormat = true;
Dictionary<string, string> columnNameMap = new Dictionary<string, string>();
columnNameMap.Add("EmployeeID", "YourCustomIdName");
...
// Create a new row and insert the name of each column into the first row of the table.
foreach (DataColumn column in dataTable.Columns)
{
builder.InsertCell();
string columnName = columnNameMap[column.ColumnName];
builder.Writeln(columnName);
}
How can we assign the header row in the table some background color to differentiate from each row? It needs to be applied to each page
Thanks
@kshah05 Please consider the following code:
foreach (Cell cell in table.FirstRow.Cells)
{
Shading shading = cell.CellFormat.Shading;
shading.Texture = TextureIndex.TextureSolid;
shading.ForegroundPatternColor = Color.Aqua;
}
@kshah05 Please feel free to ask in case of any issues, we will be glad to help you.