Previous Topic

Next Topic

Book Contents

Book Index

Report Designer - Band Properties

Navigator > Setup > Report Designer

Band properties control the behaviour of the bands placed in the Design Window. Properties are set using Property Editor or in code. You can also drag to set size properties in the Design Window.

AfterBand

Programming code executed by the report after the band is printed, commonly used for calculating totals, see MaxBasic.

AfterCalculateBand

Programming code that is executed after BeforeBand code is performed, and after all components in the band are calculated.

For example, this can be used when custom reports need to break calculated expression text into lines when AutoHeight and WordWrap are true. After BeforeBand code is performed, and all component texts (produced by expressions) and heights are calculated, it is possible to extract line break information. The text component (label or expression) now has object Lines with property LineCount and method GetLine(i).

For example:

  dim lines

  dim someLine

  dim someLineCount

  lines = SomeNamedExpression.Lines

  someLineCount = lines.LineCount

  if someLineCount>0 then

    rem Getting the last line

    someLine = lines.GetLine(someLineCount - 1)

  end if

A Text component has the following properties that can only be reliably used only in AfterCalculateBand, except for static labels:

  • TextWidth - width of non-wrapped text (even if WordWrap is true).
  • TextWrappedWidth - exact width of wrapped text (it may differ from component width).
  • TextHeight - height of non-wrapped text (if text contains carriage return line feed, line height will be actual text height of two or more lines).
  • TextWrappedHeight - exact height of wrapped text (may differ from component height).

This property is available for bands with an AutoHeight property, and is not available for fixed height bands.

Alignment

Applies to Watermark and Overmark bands, other band types ignore this property. This property allows Watermark and Overmark bands to be placed on appropriate parts of a page without the need to accurately size the band to the page size.

  • avTop - Align band to top of page
  • avBottom - Align band to bottom of page
  • avCenter - Centre band vertically on page

AlignWithMargins

When set to True, the component will align with the page margins.

AutoHeight

When set to True, the band changes its height if it contains Components with AutoHeight True property. The band's height also preserves the gap between closest bottom boundary of components and the bottom of the band. Only applies to affects Detail, Group Header, Group Footer and Summary bands.

BandType

The type of band:

  • btWatermark - Watermark Band
  • btTitle - Title Band
  • btPageHeader - Page Header Band
  • btColumnHeader - Column Header Band
  • btGroupHeader - Group Header Band
  • btDetail - Detail Band
  • btGroupFooter - Group Footer Band
  • btPageFooter - Page Footer Band
  • btSummary - Summary Band
  • btOvermark - Overmark Band
  • btIntroduction - Introduction Band

See Report Designer Band Selection.

BeforeBand

Programming code executed by the report before the band is printed, used for calculating values to be printed in the band. See MaxBasic for details on writing code.

Enabled

False, the band will not print and its BeforeBand and AfterBand code will not be executed. It is usually set only while the report is running to conditionally make a band unavailable. For example, if the AfterBand code sets Enabled to False, it ensures the band only prints once (as after that it would be unavailable).

ExportRowCount

Used to export reports to an Excel spreadsheet, CSV or tab delimited text file. It specifies the minimum number of lines to output for the band. For example, specifying 3 ensures the band uses at least three lines in the spreadsheet or output file. Text components placed on the band need the ExportField and ExportRow properties set to determine their position in the spreadsheet or export file.

Font

Font for the printed output. Click Narrative Open Font Dialog (F2)to select the font, style, size and characteristics. Click the font buttons on the toolbar to change fonts.

This can be overridden if the ParentFont property is True, see below.

ForceNewPage

True, a new page will always be started before this band is printed.

ForceNewWorksheet

True, when printing to Excel, or in Excel format, a new worksheet including any headers will always be started before this band is printed.

FreezeExcelColumns

For export to Excel worksheet, set an export column number to freeze at. Applies for PageHeader and ColumnHeader bands only.

FreezeExcelHeaders

Not visible in the Property Inspector, applies to PageHeader and ColumnHeader bands. Set True to freeze before or after in corresponding BeforeBand or AfterBand code.

Group Expression

 

Applies to Group Header and Group Footer bands. A group break will apply when the expression entered changes in value.

Height

The height in millimetres. A band's height must allow components placed in the band to be visible. Sometimes it is useful to have a band with a height of zero. Such a band cannot contain components and will not print on the report, but the BeforeBand and AfterBand code will execute. For example you could have a report that only prints data in a Summary Band but calculates the summary information across all records using the BeforeBand and AfterBand code on a zero height Detail band.

Name

Bands have names, allocated when created, such as Newband1. We recommend changing the name to something meaningful to you, see Report Designer Naming Conventions. Bands can only be referred to by name if they adhere to variable name conventions (the name can be a variable name). A named band can be:

  • Selected from the drop down list at the top of Property Editor.
  • Referred to in programming code written in the report and you can change properties on the band during generation of the report.

OnFirstLastPage

Only applies to Page Header and Page Footer bands.

True, the band will be printed on the first and last pages.

False, a Page Header band will not be printed on the first page and a Page Footer band will not be printed on the last page.

ParentCustomHint

True, the Custom Hint from the parent (the report) is used.

ParentFont

True, the band gets font information from the font of its parent (the report).

False, the band uses its own Font property.

Setting to True means you can change the report font and have all components on the band (that also have ParentFont set to True) change to the same font.

Repeated

May be set True in AfterBand code for a band which triggers the band to print again. Resets to False automatically BeforeBand.

e.g. May be used to iterate through a MemoryTable and print information from each record.

SplitAcross

For Detail, Group Header, Group Footer and Summary bands this controls whether the band can be split across two pages if it will not fit in the space remaining, or started on the new page.

When a band splits the split line goes between components (if and where it is possible). Only expression components (with several lines of text) are split between lines.

For other band types, such as Page Header, Page Footer, Watermark and Overmark, SplitAcross is always false. If Autoheight is true and the band won't fit in the space available, it is truncated.

Width

The width of the band. All bands on a report have the same width.

In This Section

Report Designer Band Selection