I am using gotreportviewer's Dynamic Table report to generate reports.
Here we will be populating data in the dataset and generate dynamically.
I would like to know how to change Report Column(Header) background color programmatically.
Please replace the below code in TableRdlGenerator.cs (line 110)
private Rdl.StyleType CreateHeaderTableCellTextboxStyle()
{
Rdl.StyleType headerTableCellTextboxStyle = new Rdl.StyleType();
headerTableCellTextboxStyle.Items = new object[]
{
"700",
"14pt"
};
headerTableCellTextboxStyle.ItemsElementName = new Rdl.ItemsChoiceType5[]
{
Rdl.ItemsChoiceType5.FontWeight,
Rdl.ItemsChoiceType5.FontSize
};
return headerTableCellTextboxStyle;
}
with
private Rdl.StyleType CreateHeaderTableCellTextboxStyle()
{
Rdl.StyleType headerTableCellTextboxStyle = new Rdl.StyleType();
headerTableCellTextboxStyle.Items = new object[]
{
"700",
"14pt",
Color.Black
};
headerTableCellTextboxStyle.ItemsElementName = new Rdl.ItemsChoiceType5[]
{
Rdl.ItemsChoiceType5.FontWeight,
Rdl.ItemsChoiceType5.FontSize,
Rdl.ItemsChoiceType5.BackgroundColor,
};
return headerTableCellTextboxStyle;
}