Reports for WPF | ComponentOne
C1.C1Report Namespace / Field Class / SubreportHasData Property
Example

In This Topic
    SubreportHasData Property (Field)
    In This Topic
    Returns whether a subreport has data and suppresses rendering if it doesn't.
    Syntax
    'Declaration
     
    Public ReadOnly Property SubreportHasData As Boolean
    public bool SubreportHasData {get;}
    Remarks
    This property allows you to check whether a subreport has data and prevent it from rendering if it doesn't.
    Example
    The code below uses script to hide sections with empty subreports: The code below uses script to hide a field containing an empty subreport and show another field instead:
    _c1r.Sections.Detail.OnPrint = "Detail.Visible = fSubreport.SubreportHasData"
    _c1r.Sections.Detail.OnPrint = 
        "hasData = fSubreport.SubreportHasData\r\n" +
        "fSubreport.Visible = hasData" +
        "fNoData.Visible = Not hasData\r\n" +
    See Also