ReportPrintOptions.PrintOnEmptyDataSource Property
Specifies whether a report should be printed if its data source has no data.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v24.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | true |
|
Property Paths
You can access this nested property as listed below:
Object Type | Path to PrintOnEmptyDataSource |
---|---|
XtraReportBase |
|
Remarks
If you don’t want documents to be created when the report receives no data from its data source, set the PrintOnEmptyDataSource
property value to false. This PrintOnEmptyDataSource
property will then ensure that reports are not printed, exported, or previewed.
The PrintOnEmptyDataSource
property disables report printing if the report data source is empty; that is, the data source returns no data. If you specify a filter string that filters out all data in the data source, the data source returns no data and the PrintOnEmptyDataSource
setting is applied.
The property is available for the XtraReport and DetailReportBand classes. You can set the PrintOnEmptyDataSource
property to false
for the XtraReport to hide the master report when its data source is empty. If you set the PrintOnEmptyDataSource
property to false
for the DetailReportBand, the detail report will then be hidden when its data source contains no data.
To specify the number of times the Detail band should be displayed in the document, use one of the following settings:
- When a report is bound to a data source which returns data, use the DetailCount and DetailCountAtDesignTime properties.
- When no data source is defined for the report, use the DetailCountOnEmptyDataSource property.