AddBand Method

[Top]  [Chapter]  [Previous]  [Next]

Create a band definition in the DB-Description.

Applies to

IWPReport

Declaration

procedure AddBand(const Group: WideString; const Title: WideString; BandType: Integer; ColumnCount: Integer; const FieldList: WideString; const ParStyle: WideString; RadioGroup: Integer; Mode: Integer);

Description

You can use AddBand to build a DB-Description (which can be saved and loaded in XML format). The use of DB-Descriptions makes it easier for the end user to manage the report template since the technical details are hidden.

Parameters

Group

The name of the parent group. Use "*" to select current group. An empty string will insert band at the top level.

 

Title

The Title of the band. This will be displayed in the template editor.

 

BandType

Selects the band type and the visibility:

bit 1(=1): Creates a header band.

bit 2(=2): Creates a footer band.

 

The bits 3-5 are only used for headers and footers in groups:

bit 3(=4): Hide at start (headers) and end (footers) of group

bit 4(=8): Also display after (headers) and before page breakes (footers). This bit is used to display sub totals in footers! We recommend to create two footers, one with bit 3 and 4 set, the other with both bits clear.

bit 5(=16): reserved.

 

The bits 6-7 are only used for header and footers at top level which are used to create document header and footers. If none of these bits is set, the band is always used:

bit 6(=32): Hide text on first page.

bit 7(=64): reserved

bit 8(=128): Show text on odd pages only.

bit 9(=256): Sow text on even pages only.

bit 10(=512): Only use when selected (see RadioGroup)

Example BandType Values:

 BANDTYP_HEADER_ALL   = 1;

 BANDTYP_FOOTER_ALL   = 2;

 BANDTYP_HEADER_FIRST = BANDTYP_HEADER_ALL + 16;

 BANDTYP_FOOTER_FIRST = BANDTYP_FOOTER_ALL + 16;

 BANDTYP_FOOTER_LAST  = BANDTYP_FOOTER_ALL + 32;

 BANDTYP_OVERFLOW_HEADER = BANDTYP_HEADER_ALL + 4+8;

 BANDTYP_OVERFLOW_FOOTER = BANDTYP_FOOTER_ALL + 4+8;

Note

When the DB-Description is saved to XML the bits 3 and 4 are converted into bit 1 and 2 of parameter "Usage". The bits 5 to 8 are converted into bit 1 to 4 of the parameter "Visibility"

ColumnCount

This is the count of columns which should be created. The value can be 0 if the fields of the group are used - see Mode. If the ColumnCount<0 no columns will be created and the text specified in string "FieldList" will be used to create regular text. "FieldList" can be also specified as HTML text using bit 4 in Mode.

FieldList

This is a comma separated list of the fields which should be used. Can be "" if the fields in the group are used.

ParStyle

Either "" or paragraph style for the table cells which are created.

RadioGroup

"RadioGroup" is under development - reserved for future

If this value is not 0, a "radio band" will be created. Radio bands can be enabled or disabled in the template editor (not the repository!) and only the enabled band will be used during the reporting process. The group number is taken from the low word of this parameter. Enabling a band automatically disables all other bands which use the same number and are not "siblings". Siblings are bands which use the same group number in low word and the same sibling number > 0 in the high word. The BandType bit 10 is assumed when the value of RadioGroup is not 0.

 Example:

 GROUP1 = 1;

 GROUP1_SIBLINGSA = 1 + $10000;

Mode

This parameter controls if the band is selected and how the band is used to create a reporting template.

bit 1: In the repository the user cannot change the selected state.

bit 2: The band is not selected.

bit 3: Do not create default columns when the the ColumnCount value is 0. Unless a field list has been specified, the "default columns" are created for all selected fields and variables in the same group.

bit 4: Use the field text as HTML source. If this bit is set you can specify text and fields for each column.

Example:

"<field name="Product"/>,<field name="Amount"/>,<b><field name="Price"/></b>"

bit 5: The band is hidden in the repository. It can still be selected to create a band in the report template.


[idh_iwpreport_addband.htm]    Copyright © 2007 by WPCubed GmbH