Adding System and Calculated Fields


Adding calculated and system fields to reports, such as page numbers and running totals.

Page Numbers and Dates

You may use the Drag-and-Drop List to place objects on a layout of any type:

Inserting Calculations in Reports

You can create calculated fields for individual report layouts to display calculations. Unlike calculated fields created for a table or set, a report's calculated fields are only available to that report, and not to other layouts. Calculated fields can perform calculation using data from a single record. You can also perform summary calculations, such as totals and averages, using data from multiple records. Calculated fields can also display simple calculations, such calculating today's date or the current page number. The diagram below shows examples of each of these uses.

Reports - HTML Calculated Fields

You can now define calculated fields in a report that render as HTML. Your calculated field expression returns an HTML string which Alpha Anywhere renders. This is a very powerful new feature. It will allow users to exercise an enormous amount of creativity in formatting a report. To use this feature, define a calculated field using the new printHTML() function.

Placing a Running Count on a Report

This procedure explains how to place a running count of items on a report that produces something like the following. Note the sequence of numbers at the left of each Product ID.

How to fix incorrect report page totals

Sometimes when you create a multi-page report in Alpha Anywhere, you discover that the page totals don't match the sum of the amounts visible on the page. This can happen if there is vertical space above the location of the page total, and the next item in the report, which actually appears on the next page, is included in the current page because its detail region has been split.

Proper Use of the GRP->Sub_Group Expression

Alpha Anywhere provides many aggregation functions that are used in reports to TOTAL(), AVERAGE() and summarize other numerical fields. These functions have a similar syntax, which includes an optional third argument. In most cases Alpha Anywhere can infer the correct value for this expression. In a limited number of cases, when you place a calculated field that has a constant value, you must explicitly state what the expression should be.