Back to Devexpress

ReportPrintOptions.DetailCountOnEmptyDataSource Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-reportprintoptions-9605371c.md

latest5.7 KB
Original Source

ReportPrintOptions.DetailCountOnEmptyDataSource Property

Specifies how many times the Detail band should be printed when no data source is defined for the report.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(1)]
public int DetailCountOnEmptyDataSource { get; set; }
vb
<DefaultValue(1)>
Public Property DetailCountOnEmptyDataSource As Integer

Property Value

TypeDefaultDescription
Int321

An integer value.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to DetailCountOnEmptyDataSource
XtraReportBase

.ReportPrintOptions .DetailCountOnEmptyDataSource

|

Remarks

Use the DetailCountOnEmptyDataSource property, to specify how many times the Detail band is printed, when no data source is defined for the report.

To specify the number of times the Detail band is printed when a data source is defined for the report (and it is not empty), use the ReportPrintOptions.DetailCount property.

To limit the number of records shown when a report is previewed at design time, use the ReportPrintOptions.DetailCountAtDesignTime property.

To choose whether or not a report should be printed when its data source has no data, use the ReportPrintOptions.PrintOnEmptyDataSource property.

To learn more, see Data Filtering Overview.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DetailCountOnEmptyDataSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

reporting-winforms-label-report-in-code/CS/Reporting_how-to-create-a-label-report-at-runtime-t473792/LabelReportRuntime/CustomLabelReportBuilder.cs#L60

csharp
var labelInfo = DevExpress.XtraReports.Wizards.Builder.ReportInfoFactory.CreateLabelInfo(GetDefaultLabelReportMode(model));
report.ReportPrintOptions.DetailCountOnEmptyDataSource = labelInfo.CalculateLabelCount(paperKindList.Size, paperKindList.UnitDpi);
if (labelInfo.MoreOneColumnOnPage(paperKindList.Size, paperKindList.UnitDpi)) {

reporting-winforms-repeat-detail-band-multiple-times/CS/RepeatDetailBandExample/XtraReport1.cs#L28

csharp
currentDetail = 1;
DetailReport.ReportPrintOptions.DetailCountOnEmptyDataSource =
    Convert.ToInt32(GetCurrentColumnValue("CategoryID"));

reporting-winforms-label-report-in-code/VB/Reporting_how-to-create-a-label-report-at-runtime-t473792/LabelReportRuntime/CustomLabelReportBuilder.vb#L59

vb
Dim labelInfo = DevExpress.XtraReports.Wizards.Builder.ReportInfoFactory.CreateLabelInfo(GetDefaultLabelReportMode(model))
report.ReportPrintOptions.DetailCountOnEmptyDataSource = labelInfo.CalculateLabelCount(paperKindList.Size, paperKindList.UnitDpi)
If labelInfo.MoreOneColumnOnPage(paperKindList.Size, paperKindList.UnitDpi) Then

reporting-winforms-repeat-detail-band-multiple-times/VB/RepeatDetailBandExample/XtraReport1.vb#L25

vb
currentDetail = 1
    DetailReport.ReportPrintOptions.DetailCountOnEmptyDataSource = Convert.ToInt32(GetCurrentColumnValue("CategoryID"))
End Sub

See Also

ReportPrintOptions

ReportPrintOptions Class

ReportPrintOptions Members

DevExpress.XtraReports.UI Namespace