hello - i want to have repeat header but using headingformat = true does not work. Please see code enclosed below.
builder.MoveToBookmark(aComment);
builder.StartTable();
builder.CellFormat.ClearFormatting();
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.RowFormat.HeadingFormat = true;
for (int j = 0; j <resultTable.Columns.Count; j++)
{
builder.InsertCell();
builder.RowFormat.HeightRule = HeightRule.AtLeast;
builder.RowFormat.Height = 0;
builder.CellFormat.WrapText = false;
builder.CellFormat.FitText = false;
builder.Font.Size = 8;
builder.CellFormat.Shading.BackgroundPatternColor = Color.FromArgb(153, 204, 255);
builder.Font.Color = Color.DarkBlue;
builder.Font.Bold = true;
string aCell = resultTable.Columns[j].ColumnName;
if (j> 0)
{
builder.CellFormat.Width = 100;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Write(aCell);
}
else
{
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.CellFormat.Width = 200;
}
}
builder.EndRow();
builder.RowFormat.HeadingFormat = false;
string oldRegion = "default";
for (int f = 0; f <resultTable.Rows.Count; f++)
{
DataRow aRow = resultTable.Rows[f];
if (aRow[0].ToString() != oldRegion) builder.InsertBreak(BreakType.LineBreak);
for (int j = 0; j <resultTable.Columns.Count; j++)
{
builder.RowFormat.HeightRule = HeightRule.AtLeast;
builder.RowFormat.Height = 0;
builder.CellFormat.WrapText = false;
builder.CellFormat.FitText = false;
builder.InsertCell();
builder.Font.Bold = false;
if (j> 0)
{
builder.CellFormat.Shading.BackgroundPatternColor = Color.White;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Font.Color = Color.Black;
builder.CellFormat.Width = 100;
}
else
{
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.CellFormat.Shading.BackgroundPatternColor = Color.FromArgb(153, 204, 255);
builder.Font.Color = Color.DarkBlue;
builder.CellFormat.Width = 200;
}
string aCell = string.Empty;
if (aRow[j].ToString() != oldRegion || j != 0)
{
aCell = aRow[j].ToString();
if (j == 0) oldRegion = aCell;
}
builder.Write(aCell);
}
builder.EndRow();
}
builder.EndTable();