ReportPrintOptions.PrintOnEmptyDataSource Property
Specifies whether or not a report should be printed if its data source is empty.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v22.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | true | true to allow printing a report when its data source is empty; otherwise false. |
Property Paths
You can access this nested property as listed below:
Library | Object Type | Path to PrintOnEmptyDataSource |
---|---|---|
WinForms Controls | XtraSchedulerReport |
|
Reporting | DetailReportBand |
|
XtraReport |
|
|
XtraReportBase |
|
Remarks
Set the PrintOnEmptyDataSource property value to false, to avoid generating a report when its data source is empty.
This property is in effect every time you create a report document (the XtraReport.CreateDocument method is called), irrespective of whether it’s being printed, exported or previewed.
Note
Since this property is declared in a base ReportPrintOptions class, it is intended to provide this functionality for both the XtraReport and DetailReportBand classes. Therefore, this makes it possible to hide not only the master report when its data source is empty, but also the detail report when its data source contains no data.
To specify the number of times the Detail band is printed, you have the following options.
- when a data source is defined for the report, and it is not empty, use the ReportPrintOptions.DetailCount and ReportPrintOptions.DetailCountAtDesignTime properties;
- when no data source is defined for the report, use the ReportPrintOptions.DetailCountOnEmptyDataSource property.