I'm building a report that uses a subreport in the report header. This subreport will only occasionally contain data, so I have used this link to help me hide the subreport when it has no data, and this works fine. However, I also want to force the subreport to be on its own page when it is visible, but I can't figure out the appropriate binding to make this happen.
For the reportHeader section (that contains the subreport), I already have the following binding:
Property Path: Height
Expression: = "1px"
I want to add
Property Path: PageBreak
Expression: = IIF(???, PageBreak.After, PageBreak.None)
I tried setting ??? to ReportItem.Height > "1px", but that caused error "Cannot perform '>' on Telerik.Reporting.Drawing.Unit and System.String.
I tried setting ??? to ReportItem.subreport2.Visible that caused error object subreport2 not defined in the current context.
What is the correct binding code to detect if the subreport was visible or not?
Alternatively, in code I have tried
but this doesn't work, because the report hasn't executed when I test the Visible property. Can I do something differently to make it work this way?
Thanks
For the reportHeader section (that contains the subreport), I already have the following binding:
Property Path: Height
Expression: = "1px"
I want to add
Property Path: PageBreak
Expression: = IIF(???, PageBreak.After, PageBreak.None)
I tried setting ??? to ReportItem.Height > "1px", but that caused error "Cannot perform '>' on Telerik.Reporting.Drawing.Unit and System.String.
I tried setting ??? to ReportItem.subreport2.Visible that caused error object subreport2 not defined in the current context.
What is the correct binding code to detect if the subreport was visible or not?
Alternatively, in code I have tried
var rptBook =
new
ReportBook();
var rpt1 =
new
MyReport1();
if
(rpt1.Report.Visible) rptBook.Reports.Add(rpt1);
var rpt2 =
new
MyReport2();
rptBook.Reports.Add(rpt2);
but this doesn't work, because the report hasn't executed when I test the Visible property. Can I do something differently to make it work this way?
Thanks