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

I need help with string concatenation....

Status
Not open for further replies.

cdnamm

Programmer
Oct 25, 2002
41
US
I want to concatenate the diagnosis code (if more than 1) in the detail tables into one string and put it on a group footer, but my string would only get the diagnosis code of the last detail record only.

 
You need to use a variable to "accumulate" the string.

In the group header:
---------------------------------
whileprintingrecords;
Global Stringvar gs_result := "";
---------------------------------

In the detail section:
---------------------------------
whileprintingrecords;
Global Stringvar gs_result ;
gs_result := gs_result + " " + {your_string_field};
---------------------------------

In the group footer:
---------------------------------
whileprintingrecords;
Global Stringvar gs_result ;
---------------------------------

Cheers,
- Ido


CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Hi IdoMillet,
I tried it your way and it worked!
But I got another problem. Since the stringvar
in a calculated field can only be at most 254 characters,
so I couldn't show some of my diagnosis string. Do
you have any way to work around this problem?
Thank you very much for your help!
cdnamm.
 
Update to CR 9.0 where that limitation was removed
or create two variables and start loading the second one
once the first one approaches the limit.

Another very good alternative is to insert a subreport
in the Group Footer where you display diagnosis codes
for that group in a detail section using the FORMAT option
of "Format with Multiple Columns"...

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top