Returns whether a subreport has data and suppresses rendering if it doesn't.

Namespace:  C1.C1Report
Assembly:  C1.C1Report.2 (in C1.C1Report.2.dll)

Syntax

C#
[BrowsableAttribute(false)]
public bool SubreportHasData { get; }
Visual Basic
<BrowsableAttribute(False)> _
Public ReadOnly Property SubreportHasData As Boolean
	Get

Remarks

This property allows you to check whether a subreport has data and prevent it from rendering if it doesn't.

Examples

The following code uses script to hide sections with empty subreports:

Copy CodeC#
c1r.Sections.Detail.OnPrint = "Detail.Visible = fSubreport.SubreportHasData"

The following code uses script to hide a field containing an empty subreport and show another field instead:

Copy CodeC#
c1r.Sections.Detail.OnPrint = "hasData = fSubreport.SubreportHasData\r\n" +
"fSubreport.Visible = hasData\r\n" +
"fNoData.Visible = Not hasData"

See Also