Skip to main content

DetailBand.FillEmptySpace Property

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.v23.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultValue(false)]
[SRCategory(ReportStringId.CatBehavior)]
public bool FillEmptySpace { get; set; }

Property Value

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.

Remarks

If you enable the FillEmptySpace property, the report prints the Detail band as follows:

  • Detail band copies fill the empty space below the band.
  • Detail band copies retain the layout of the original band.
  • Detail band copies are not bound to data.
  • Report controls in these copies are printed without data.

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.

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.

Text Property

If the Detail band includes line numbers, the band copies display them.

Line Numbers

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.

Limitations

  • If a report contains Group Footer or Report Footer bands, and the respective ReportFooterBand.PrintAtBottom or GroupFooterBand.PrintAtBottom options are disabled, the FillEmptySpace option has no effect.
  • The FillEmptySpace option is not intended for use in subreports. This option may print a report incorrectly.

Runtime Example

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:

detailband-fillemptyspace-sample-preview

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;
}
See Also