For most presentation styles, the DataWindow painter Design view is divided into areas called bands. Each band corresponds to a section of the displayed DataWindow object.
DataWindow objects with these presentation styles are divided into four bands: header, detail, summary, and footer. Each band is identified by a bar containing the name of the band above the bar and an Arrow pointing to the band.
These bands can contain any information you want, including text, drawing controls, graphs, and computed fields containing aggregate totals.
The following picture shows the Design view for a tabular DataWindow object.
Band |
Used to display |
---|---|
Header |
Information at the top of every screen or page, such as the name of the report or current date |
Detail |
Data from the database or other data source |
Summary |
Summary information that displays after all the data, such as totals and counts |
Footer |
Information displayed at the bottom of every page or screen, such as page number and page count |
The header band contains heading information that is displayed at the top of every screen or page. The presentation style determines the contents of the header band:
-
If the presentation style is Tabular, Grid, or N-Up, the headings defined for the columns in the Database painter display in the header band and the columns display on a single line across the detail band
-
If the presentation style is Freeform, the header band is empty and labels display in the detail band next to each column
You can specify additional heading information (such as a date) in the header band and you can include pictures, graphic controls, and color to enhance the appearance of the band.
Displaying the current date
To include the current date in the header, you place a computed field that uses the Today DataWindow expression function in the header band. For information, see Adding computed fields to a DataWindow object.
The detail band displays the retrieved data. It is also where the user enters new data and updates existing data. The number of rows of data that display in the DataWindow object at one time is determined by the following expression:
(Height of the DataWindow object– Height of headers and footers) / Height of the detail band
The presentation style determines the contents of the detail band:
If the presentation style is Tabular, Grid, N-Up, or Label, the detail band displays column names, representing the columns
If the presentation style is Freeform, the labels defined for the columns in the Database painter display in the detail band with boxes for the data to the right
How PowerBuilder names the columns in the Design view
If the DataWindow object uses one table, the names of the columns in the Design view are the same as the names in the table.
If the DataWindow object uses more than one table, the names of the columns in the Design view are tablename_columnname. PowerBuilder prefaces the name of the column with the table name to prevent ambiguity, since different tables can have columns with the same name.
When you design the detail band of a DataWindow object, you can specify display and validation information for each column of the DataWindow object and add other controls, such as text, pictures, graphs, and drawing controls.
You use the summary and footer bands of the DataWindow object the same way you use summary pages and page footers in a printed report:
-
The contents of the summary band display at the end, after all the detail rows; this band often summarizes information in the DataWindow object
-
The contents of the footer band display at the bottom of each screen or page of the DataWindow object; this band often displays the page number and name of the report