Thursday, November 20, 2008

Crystal: summarising formula fields

For some crazy reason, it seems that Crystal won't easily let you summarise (sum, average, etc) calculated values. After trawling the net for a while I managed to come up with the following 'hack' to achieve this.
  1. Create a calculated field that clears an array variable & returns "";
  2. Insert this field into a group or report header;
  3. Create a calculated field that re-dimensions the array variable with an extra element, adds the calculated value to the array & returns "";
  4. Insert this field into a details line;
  5. Create a calculated field that summarises the array variable & return this out put;
  6. Insert this field into a group or report header.

No comments: