Bug with SubreportObject.Visible
I have a report with three or four subreports. Depending on the type of report, I would like to hide certain subreports.
Using the following:
report1.FindObject("Data2").Visible = false
changes nothing. The subreport is still being displayed.
I also wouldn't mind completely deleting the subreport, but when calling
report1.FindObject("Data2").Delete()
a NullReferenceException ("Object reference not set to an instance of an object.") occurs. After placing that line in its own try..catch block the subreport is deleted though.
Is this a bug, and what workaround is there to hide/delete a subreport?
Thanks
Riaan
Using the following:
report1.FindObject("Data2").Visible = false
changes nothing. The subreport is still being displayed.
I also wouldn't mind completely deleting the subreport, but when calling
report1.FindObject("Data2").Delete()
a NullReferenceException ("Object reference not set to an instance of an object.") occurs. After placing that line in its own try..catch block the subreport is deleted though.
Is this a bug, and what workaround is there to hide/delete a subreport?
Thanks
Riaan
Comments
There is a bug in FastReport's code, it ignores visibility flag of subreport. I will fix it in the next build.