Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Business Objects: Crystal Reports 1 Formulas FAQ

Formula Help

Basics of totals by Madawc
Posted: 25 Jan 07 (Edited 26 Jan 07)

This is for someone who's new to Crystal.  Who's maybe used the 'wizards' for the basics, but now wants to do more.

There are several ways to find totals: running totals, summary totals and variables.  Right-click on a field and choose Insert to get a choice of Running Total or Summary.  Or else use the Field Explorer, the icon that is a grid-like box, to add running totals.  
Running totals allow you to do clever things with grouping and formulas.  They also accumulate for each line, hence the name.  The disadvantage is that they are working out at the same time as the Crystal report formats the line.   You cannot test for their values until after the details have been printed.  You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.  
They also use more machine-time than other types of total, so don't use them without good reason.
Summary totals are are based directly on the data.  This means that they can be shown in the header.  They can also be used to sort groups, or to suppress them.  Suppress a group if it has less than three members, say.  They default to 'Grand Total', but also can be for a group.
They are more efficient than Running totals, but less flexible.   
Variables are user-defined fields. One useful variant are shared variables to pass data from a subreport back to the main report.  You can also use variables to show page totals.  For normal counting I find running totals or summary totals much easier.
Directly Calculated Totals within a Formula Field can be coded directly, with commands like Sum ({ADV01.Advance}, {ADV01.AccType}).  The same result can be achieved by picking up an existing Variable, and will keep the code even if the Variable itself is later deleted.  Formula fields can also include Running Totals and other Formula Fields, with some limits depending on when the values are calculated.

It is also possible to get totals using a Formula Field, which can contain a Variable or a Directly Calculated Total.
To get yourself familiar with the idea, try doing a test report with a summary total and a running total for the same field, placed on the detail line.  You'll find that the running total increases as each line is printed, whereas the summary total has the final value all along.

For some sorts of totalling, a Crosstab would be a better option.  This can group records using values different from the main report.  Try Insert > Crosstab and it will guide you through the process.

All of the above is based primarily on Crystal 10.  Options vary a little between versions, which is why any request for help should mention it.

Back to Business Objects: Crystal Reports 1 Formulas FAQ Index
Back to Business Objects: Crystal Reports 1 Formulas Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close