Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SubreportBase.ReportSourceRowCount Property

Returns the number of rows in the data source associated with the report the subreport control currently processes.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

[Browsable(false)]
public int ReportSourceRowCount { get; }

#Property Value

Type Description
Int32

The number of data rows.

#Remarks

You can use the ReportSourceRowCount property to conditionally hide the subreport. The following code snippet handles the XRSubreport control’s BeforePrint event and does not display a detail report in a Master-Detail report if the detail report contains no data:

private void xrSubreport1_BeforePrint(object sender, CancelEventArgs e) {
   e.Cancel = ((XRSubreport)sender).ReportSourceRowCount = 0;
}
See Also