Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: How To (Forms, Reports, and more) > Reports and Labels > Technical Documents

Understanding DB Calc Objects

Scroll Prev Top Next More

The DB Calc object is a data-aware control within the Report/Label Designer used to perform aggregate function calculations, and display the resulting value. The calculation can be based on a COUNT, SUM, MINIMUM, MAXIMUM, and AVERAGE of a column/field value. The DB Calc can eliminate the use of aggregate functions used in report/label expressions, allowing the report engine to perform the calculations.

 

After a DB Calc object is added to a report/label, use the Edit toolbar to specify the column/field to based the calculations upon.

 

DB_Calc_EditToolbar

 

 

Then, right click on the DB Calc object and select "Calculations" to specify the calculation properties.

 

DB_Calc_Calculations

 

 

The "Calc Type" property determines what type of aggregate function is performed for the control. The "Reset Break" property (optional) is available to reset a calculated value to zero each time the Report Break is encountered. The Break name can be selected from the list of defined Breaks.

 

Count - count one for each row in a break

Sum - sum data values for each row in a break

Minimum - minimum data value for each row in a break

Maximum - maximum data value for each row in a break

Average - average of all data values for each row in a break

 

 

The "Look Ahead" option, available through the right click speed menu for the DB Calc, is designed to display summary calculations in the title band, page footer calculations in the page header band, group footer calculations in the group header band, and column footer calculations in the column header. When the Look Ahead property is checked, the draw command which represents the component on the rendered page will continue to update with the most recent calculation value until the report completes the generation of the associated page or break. Note: The report "Pass Setting" property must be set to "Two Pass" in order for Look Ahead calculations to function reliably.

 

Use the "Display Format" property to control how the text is formatted. Text alignment of the caption is determined by the value of the Alignment property. You can force the control to resize to fit a changing caption by setting the "Auto Size" property to True. You can control the appearance of this component (Font, Alignment, etc.) at design-time by using the Format Bar of the Designer.