Crystal Reports on the web

Looking at the huge number of links, my code snippets and samples that I've accumulated during my journey with Crystal Reports and Report Server (RAS), I've realized that something should be done with all that. So, for all who are struggling with similar problems I've faced while pursuing that elusive goal of putting Crystal Reports on the web, I will put as much information here as I can ...

Monday, August 23, 2004

Report design - how to get sums in Header instead of footer

Sometimes it's necessary to put sums in header instead of more natural place, footer.
If you don't have grouping, it should look like this:
1) create formula field that you will put in report header
2) Important: put WhilePrintingRecords on the top of the formula

WhilePrintingRecords
Dim total As Number
total = sum({field1})
formula = total

3) put formula in Report Header

If you do have groups, you should add group field {field2} into the sum:

WhilePrintingRecords
Dim total As Number
total = sum({field1}, {field2})
formula = total