Skip to main content

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

[DefaultValue(true)]
public bool PrintOnEmptyDataSource { get; set; }

Property Value

Type Default Description
Boolean true

True - a report can be printed when its data source is empty; false - a report cannot be printed when its data source is empty.

Property Paths

You can access this nested property as listed below:

Object Type Path to PrintOnEmptyDataSource
XtraReportBase
.ReportPrintOptions .PrintOnEmptyDataSource

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:

See Also