xtrareports-devexpress-dot-xtrareports-dot-ui-dot-detailband-75a1c7e2.md
Gets or sets whether to fill the empty space between the Detail band and the next band or the end of the page.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[DefaultValue(false)]
[SRCategory(ReportStringId.CatBehavior)]
public bool FillEmptySpace { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(False)>
Public Property FillEmptySpace As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
True to fill the empty space between the DetailBand and the next band or the end of the page; otherwise, false.
|
If you enable the FillEmptySpace property, the report prints the Detail band as follows:
Note that there must be a gap between the DetailBand and the content that follows it on the page. Otherwise, the FillEmptySpace option will not work.
Consider a report layout with the GroupFooterBand positioned below the DetailBand and its PrintAtBottom option disabled. In this situation, the FillEmptySpace option is unavailable because there is no gap between the Detail band and the Group Footer band that follows.
The following images illustrate how the FillEmptySpace property setting affects the report printout.
There is no space between the DetailBand and GroupFooterBand.
The space between the DetailBand and GroupFooterBand is not populated.
The space between the DetailBand and GroupFooterBand is populated.
You can display static text in the band copies that populate empty space. To do this, specify the Text property of the controls in the Detail band.
If the Detail band includes line numbers, the band copies display them.
For an example of use, review the following help topic: Create a Report with Cross-Band Content and Populated Empty Space in the VS Report Designer.
View Example: Reporting for WinForms - Add Blank Rows and Fill Empty Space to the End of the Page
Tip
Handle the XtraReport.FillEmptySpace event to populate empty space with custom content.
FillEmptySpace option has no effect.FillEmptySpace option is not intended for use in subreports. This option may print a report incorrectly.The following code snippet illustrates how to populate the empty space between the DetailBand and the bottom of the page. The XRLabel control in the detail band is bound to the [CategoryName] data field. The label’s Text property contains a string composed of three dashes. When the report is printed, the data-bound band copies display field data and the unbound band copies display dashes:
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;
}
Imports System.Drawing
Imports System.Drawing.Printing
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraPrinting
' ...
Public Shared Function CreateReport() As XtraReport
' Create an XtraReport instance.
Dim report As New XtraReport()
' Create the DetailBand and add it to the report.
Dim detailBand As New DetailBand() With {.HeightF = 20, .FillEmptySpace = True}
report.Bands.Add(detailBand)
' Create a control for the category name and configure its expression bindings.
Dim lbCategoryName As New XRLabel() With {.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
End Function
See Also