Posted 11 May 2023, 6:17 am EST - Updated 11 May 2023, 6:22 am EST
Hello! I’m attempting to add a checkbox to my header row of a table on an ActiveReport RDL Multi-Section report. I can add a checkbox to a data row and it works fine, but in the header the PDF generates when I export it but it does not open due to an error (see screenshot).
Here’s my code to add a checkbox to the header.
Table table = new Table();
table.Name = "tblCompensationDetails";
//create header row
TableRow trHeader = new TableRow();
trHeader.Height = "1.25cm";
table.Height += "1.25cm";
TableCell tc = new TableCell();
TableColumn tcol = new TableColumn();
bool isTrue= true;
cb.Name = "chkHeader148";
cb.Value = "1-48";
cb.Checked = ExpressionInfo.FromString(isTrue.ToString());
cb.Style.PaddingBottom = cb.Style.PaddingLeft = cb.Style.PaddingRight = cb.Style.PaddingTop = ExpressionInfo.FromString("2pt");
cb.Style.VerticalAlign = ExpressionInfo.FromString("Middle");
cb.Style.FontSize = ExpressionInfo.FromString("7pt");
cb.Style.FontWeight = ExpressionInfo.FromString("Bold");
cb.Style.WrapMode = ExpressionInfo.FromString("WordWrap");
tc.ReportItems.Add(cb);
tcol.Width = "0.50in";
tcol.FixedHeader = true;
table.TableColumns.Add(tcol);
trHeader.TableCells.Add(tc);
I use the same exact code for the detail row (except I assign the checked value to a field on the report) and it doesn’t break. But in the header it is breaking. Is there some other setting that needs to be done for header checkboxes?
Thanks!