INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

E-mail*
Handle

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

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...You have made an incredible site which is truly a great help to me in solving problems. A tip of my hat to you!..."

Geography

Where in the world do Tek-Tips members come from?

Business Objects: Crystal Reports 1 Formulas FAQ

Formula Help

Displaying data from the details prior to the details section
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:
whilereadingrecords;
stringvar array id;
numbervar x;
if not(totext({Orders_Detail.Product ID},0,"") in id) then
redim preserve id[ubound(id)+1]
else
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:
whileprintingrecords;
stringvar array id;
join(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.

-k

Back to Business Objects: Crystal Reports 1 Formulas FAQ Index
Back to Business Objects: Crystal Reports 1 Formulas Forum
My FAQ Archive
Email This FAQ To A Friend

My Archive