Creating DataWindow Reports
\The Sandbox \PB History & Future \New in PB 2 \Painter Features \DataWindow Painter \DataWindow Reports
Assigning
Accelerators
Tag Values
DW Icon
Comments
Changing
Databases
Controlling DW
Updates
OLE Columns
DataWindow
Reports
Dynamic DWs
Runtime Print
Specifications
Displaying the
DDLB Arrow
Displaying
Row Counts
Sort and Filter
Testing
Modifying Result
Sets Descriptions
Moving Object
with Keyboard
Naming Objects
Aggregate
Functions
New Color Bar
Events
DW Functions
New Menu Items
Grid Style
Shortcut Keys
Align Objects
Size Objects
Space Objects
Saving DWs
with Comments
Keyboard Object
Selection
Selecting a Font
Selecting a
Line Edit
Keyboard Sizing
Specifying
SQL Syntax
Background
Color
Timer Interval
Unit of Measure
Validation
Message
DB Table
Changes
Suppressing
Repeating Values
Testing an
OLE Column
Using Comments

In PowerBuilder, you can use DataWindows to display and report on database data.  You can report on specific data and can dynamically create DataWindows at runtime to report on data selected at runtime. 

Grouping Data

In DataWindows, you can group rows for reporting purposes. These groups are called groups and can be used in the DataWindow and in reports to:

Specify page breaks and page numbering

Specify header and trailer information for groupings of information

Report on information in specific groups of rows

For example, if you make column 1 (Dept_Nbr) a group, you can force a page break each time the department number changes, and can report on information for each department in the DataWindow. 

TIP:   If the rows of the DataWindow are not sorted in the data source, sort them in the DataWindow before you use them in a group. PowerBuilder does not sort the data automatically when you create a group.

Multiple Groups

You can have as many groups as you want in a DataWindow. PowerBuilder assigns each group a number (or level) when you create the group.  The first group is level 1, the next level 2, and so on. 

The numbering indicates the order of precedence for the groups.  Level 1 is the primary group and each subsequent level is a sub-level within the previous level.  For example, if group 1 contains column 1 (Dept_Nbr) and group 2 contains column 3 (Location) and you specify the new page option for both groups, a new page will occur each time the department number changes and each time the location changes within a department number.

Header and Trailer Areas

When you create a group, PowerBuilder creates two new DataWindow areas (a header area and trailer area) for the group.  Each area is identified by a bar containing the name of the area, the group, the number of each column in the group, and an arrow pointing to the area.

In the header area, you specify information that you want to display at the top of each page of information in the group.  For example, if you group the rows by department number, you might want the header to identify how the information is grouped by displaying the department number. 

In the trailer area, you specify footer information for the group.  This information displays after the last line each value in the group.  For example, you might want to provide totals for the each group within a group in the trailer.  

TIP:   You can include columns, text, and computed fields in the header and trailer areas of a group.

Groups and Expressions

You can also use groups in expressions in aggregate functions in the header or trailer areas of the group and in computed columns. For example, if a column in the DataWindow is salary, you can use a group in the Percent function in a computed column to display the percentage each salary is of the total salary for the group.

Dynamic DataWindows

When you use dynamic DataWindows, you can control the contents and appearance of the DataWindow at runtime. Using dynamic DataWindows, you can build an application in which the end users specify the data that will be retrieved from the database and how it will look (the layout and formatting) and then the applications creates a DataWindow that meets the users' specifications.

PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com