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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine All String Values from a Field on one Line

Status
Not open for further replies.

kime1974

Programmer
Oct 30, 2006
36
US
Crystal 8.5

I have a group on Account and want to show Coverages on one line in the report.

Account Coverages
City of Portsmouth Health, Dental, Life
City of Concord Dental, Life, LTD, FSA

The coverages appear individually on a separate line and we would like to roll them up for easier viewing.

Thanks!
Kim
 
Create 3 formulas:

In Group Header (suppressed):
------------------------------
whileprintingrecords;
Global Stringvar ls_result :="";
------------------------------

In Detail section (suppressed)
------------------------------------
Global Stringvar ls_result;
ls_result := ls_result + {your_field} +", "
------------------------------------

In the group footer (show):
------------------------------------
whileprintingrecords;
Global Stringvar ls_result;
left(ls_result,length(ls_result)-2)
------------------------------------

Note: in versions below CR 9.0
the string variable is limited to a length
of 254 characters.

Cheers,
- Ido


view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks Ido!

The formulas all appear to work, but when I refresh I get the a string can be at most 254 characters long. With adding all the possible coverages together with space and "," it wouldn't be over 254. Thoughts?
 
If the information should come from Group Level 2 rather than from the detail section, move the formula from the detail section to GF2.

hth,
- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top