Skip to main content
All docs
V25.1
  • 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.v25.1.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