Skip to main content
A newer version of this page is available. .

DetailBand Class

The main report band used to display recurrent data records from a report’s data source. This band cannot be deleted from a report.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v21.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public class DetailBand :
    Band,
    IDrillDownNode,
    IDetailBand

Remarks

By default, when a report is bound to a data source and the detail band contains data-bound controls, this band is printed as many times as there are records in the data source.

When the XtraReportBase.DataMember property is not specified or is specified incorrectly, the detail band will display the first data source record as many times as there are records in total.

To specify how many times the detail band should be printed with or without a data source assigned to the report, use the properties of the ReportPrintOptions class.

To specify whether or not a band’s content can be split across several pages, use its Band.KeepTogether property.

To make a report display auxiliary data under each record printed in the detail band, use the DetailReportBand to create a master-detail report.

To specify a multi-column layout for the detail band, use its DetailBand.MultiColumn property.

Tip

Although a report can only contain a single detail band, you can create any number of SubBand objects within a band.

See Introduction to Banded Reports for more details.

See Laying out Dynamic Report Contents to learn about the layout options available for this band.

Example

The following example demonstrates how to add a control to the DetailBand instance, and then add this band to a report.

using System.Drawing;
using DevExpress.XtraReports.UI;
// ...

// Create a report.
XtraReport rep = new XtraReport();

// Create a DetailBand instance.
DetailBand detail = new DetailBand();

// Create an XRLabel control.
XRLabel label = new XRLabel();

// Set its background color.
label.BackColor = Color.DarkGreen;

// Add the label to the Detail band.
detail.Controls.Add(label);

// Add the Detail band to the report.
rep.Bands.Add(detail);

// Show the report's print preview.
rep.ShowPreview();
See Also