Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display distinct column values (string) in report header section 1

Status
Not open for further replies.

zzz6

Technical User
Jun 2, 2008
2
CA
Hello:

I would like to display the distinct values within a field of all the selected records within the report header section. The column is in string format and I am thinking of using loop in the formula. Since I haven't used loop for a long time, so I have trouble in getting it right. Any help will be very much appreciated!

For example:
When user selected 100 records, then crystal report will loop through the 100 records and check for a field called "Chemistry" and returns the unique value as below in the report header section:

Chloride
Zinc
PH
 
One way of getting column values in a header (if they aren't instances of a parameter) is to insert a crosstab using the field as a row and with any summary, and then suppressing the summary and removing the grid.

Another is to insert a subreport that uses the same selection formula, with a group on the field and details suppressed.

-LB
 
I tried the crosstab solution and it works out perfectly. Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top