Does anyone know how to suppress a subreport in VB.Net 2003 using Crystal Reports 10 at runtime?
Thanks
Printable View
Does anyone know how to suppress a subreport in VB.Net 2003 using Crystal Reports 10 at runtime?
Thanks
You can't really suppress a subreport in runtime. But whatI've done in the past is this:
My DataTable has an extra column that will tell me whether or not I have to suppress the subreport. Then while in CR designer, right click on the subreport you want to supress and select FORMAT. Check the suppress checkbox and then click on the formula button (X2). Within your script check for the column value:
Code:if {YourDataTable.YourColumn} = "YourValue" then
true
Thanks Serge. Lucky for me, the only thing in this section of my report was the subreport so I just supressed the entire section. For anyone interested, this is how I did it.
VB Code:
crpt.ReportDefinition.Sections(7).SectionFormat.EnableSuppress = True