Monday, February 28, 2011

Crystal Reports : Displaying two Summaries in a Crosstab

I often find is helpful to display both a SUM and a COUNT within the rows of a Crosstab object. A recent client needed to see both the SUM of {INVOICES.AMOUNT} and the COUNT of invoices based on {INVOICES.DATE}.

After adding your Crosstab as normal, go into the "Crosstab" tab under "Format Crosstab"

1. Add a row to the crosstab for a SUM of {INVOICES.AMOUNT}
2. Add a row to the crosstab for a COUNT of {INVOICES.INVOICENUM}
a. What we want to count here is the uniqueID field in the INVOICES table
3. Hit OK
4. In order to make the values stand apart in the Crosstab cells, I like to change the text alignment (left and right) of each summarized field.

No comments: