The purpose of report footers in User Defined Reports is to provide the ability to report aggregate information (sum, average, min, max, etc.) for the report. For example, in a Salesman list, a report footer can display the sum of the YTD sales for all the salesmen in the report. The report footer may contain multiple lines.
Adding Report Footer Lines to a User Defined Report
To add a report footer line to a user defined report, click on the Footer
tab; then click on the +
The software will produce rows in the list that correspond to the columns from the body lines. The columns in the footer lines match up with the columns in the body area. The first line column headings are shown in the Column Heading column.
Now you can drag a data column, template function or text string to place in the appropriate column of the report:
Notice the characters ":Sum" following SLM_SALES_PTD inside the red box. It indicates what aggregate, if any, is associated with the footer column. The default aggregate is Sum, so if you do nothing else, this footer line will contain the sum of SLM_SALES_PTD for all lines in the body of the report. If you do not want to use the Sum aggregate, you can click on the information icon to bring up a dialog to change the aggregate:
The following is a list of the aggregates and what they do:
- Avg: Returns the average of all non-null values from the specified expression.
- Count: Returns a count of the non-null values from the specified expression.
- CountDistinct: Returns a count of the distinct values from the specified expression.
- First: Returns the first value from the specified expression.
- Last: Returns the last value from the specified expression.
- Max: Returns the maximum value from all non-null values
of the specified expression.
- Min: Returns the minimum value from all non-null values
of the specified expression.
- StDev: Estimates standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed
from the average value (the mean). Null values are ignored.
- StDevP: Calculates standard deviation based on the entire population. The standard deviation is a measure of how widely values are
dispersed from the average value (the mean). Null values are ignored.
- Sum: Returns a sum of the values of the specified expression.
- Var: Estimates variance based on a sample. Null values are ignored.
- VarP: Calculates variance based on the entire population. Null values are ignored.
Additionally, you may change the Format and Align values which were defaulted to the first body line. You cannot change the Column Heading or Length values, as that would cause a vertical misalignment in the report.
In addition to placing database columns and template functions in the footer lines, you may also drag [New Text] to the grid and specify a literal:
Notice that the length of the ID column is only 3 and the literal specified, "Grand Totals:", is much larger. Report Desk will use as much of the next columns to display the literal as it needs, as long as the following are true:
- The Align value of the literal column is "Left".
- The following columns are empty.
After you save the report and run it, you will see a report like the following, with report totals::