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

Displaying data from the details prior to the details section by synapsevampire
Posted: 27 Jan 07 (Edited 28 Jan 07)

In particular this addresses dispaying multiple database values in the report header, however this is extremely useful for many requirements.

One scenario is that one needs to display all of the distinct values of some field that the report encompasses, and a standard minimum and maximum won't cut it.

So we use the whilereadingrecords pass to acquire the values, and the whileprintingrecords to display them.

Note that I used the Access Extreme sample database for this, and intentionally converted a numeric to string to cover more scenarios:

Detail level:
stringvar array id;
numbervar x;
if not(totext({Orders_Detail.Product ID},0,"") in id) then
redim preserve id[ubound(id)+1]
id; // Crystal required an else statement here
if not(totext({Orders_Detail.Product ID},0,"") in id) then
id[ubound(id)]:= totext({Orders_Detail.Product ID},0,"");

Now we use the whileprintingrecords in the Report Header formula to show all values:
stringvar array id;

You can tweak this to show only specific rows as well, but this might help you get around some issues along these lines.

Note you can also do manual aggregates in this fashion to have them available before the printing pass.


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