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.