DetailBand.FillEmptySpace Property
Gets or sets whether to populate the empty space between the DetailBand and the next band/the end of the page.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v19.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(false)]
public bool FillEmptySpace { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | false | true, to populate the empty space between the DetailBand and the next band/the end of the page; otherwise, false. |
Remarks
When the FillEmptySpace property is enabled, the empty region below the Detail band is populated with copies of the band. The band retains its layout, but report controls are printed without data.
The following images illustrate when the FillEmptySpace property takes effect. There must be a gap on the page between a DetailBand and content that follows.
You can display static text in the band’s copies. To do this, specify the Text property of the controls in the Detail band.
If the Detail band includes line numbers, they are also added to the band’s copies.
Tip
The Create a Report with Cross-Band Content and Populated Empty Space topic describes how to create a report with a populated empty space.
Handle the XtraReport.FillEmptySpace event to populate a report’s empty space with custom content.
Runtime Example
The code sample below illustrates how to populate the empty space between the DetailBand and the bottom of the page. The report is bound to the Categories table from the sample Northwind database included in the XtraReports installation.
using System.Drawing;
using System.Drawing.Printing;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting;
// ...
public static XtraReport CreateReport() {
// Create an XtraReport instance.
XtraReport report = new XtraReport();
// Create the DetailBand and add it to the report.
DetailBand detailBand = new DetailBand() {
HeightF = 20,
FillEmptySpace = true,
};
report.Bands.Add(detailBand);
// Create a control for the category name and configure its expression bindings.
XRLabel lbCategoryName = new XRLabel() {
Text = "---",
BoundsF = new RectangleF(50, 0, 500, 25),
};
lbCategoryName.ExpressionBindings.Add(new ExpressionBinding("Text", "[CategoryName]"));
// Add the control to the band.
detailBand.Controls.Add(lbCategoryName);
// Return the resulting report.
return report;
}