Print totals at the beginning of a report

Review these instructions if you wish to print aggregate values prior to printing the first detail row. For example, you may need to print totals at the start of the report and then provide the detail rows.

To print aggregate values prior to the detail rows, the aggregate values must be part of the data schema, separate from the variables shipped with every row.

Modify your report application to send the aggregate value

In your reporting application code, send the aggregate values; ensure that these values are sent separately from the detail rows.

This will add a variable to the data schema. You can place this variable in the report header.

Figure: Data schema with row aggregate variable

Screen shot of data schema with Totals aggregate variable.

Add aggregates using a Report Schema Transformation

Rather than modify the report application, you can use a report schema transformation to add the required aggregates to the data schema.

In this example, a report schema transformation was added to aggregate the lineitemprice for all groups and for the report total.

Figure: Data schema with aggregates from a report schema transformation

Screen shot of data schema that includes aggregates from a report schema transformation.