Formula to create comma separated string

My SP has field s_Description contain different values like "Combat Banking" ,"Networking" and "DBA" etc.. in tabular form.

My problem is ..

I want to print this value on "Report header" as comma separated
(e.g. Combat Banking, Networking, DBA)

how can i create formula to print this comma separated string
Kindly help me as soon as possible

Regards
Amit
[403 byte] By [amit_pjoshi] at [2007-11-20 11:09:46]
# 1 Re: Formula to create comma separated string
If the data is in single row means there are 3 or more columns then you can do this in the Report header as.
Stringvar abd := "";
adb:= field_1 + ", " + field_2 + ", " ......

If the record is in single row with multiple colums then you have to create a subreport. And in its detail section do as

shared stringvar abc;
if length(abc) > 0 then
abc := abc + ", " + field
Else
abc := field;

as the whole data is stored in shared variable.

Now go to the report where you want to show this data and create a formul like show and write as
shared stringvar abc.

Keep this in mind to place the subreport before the section or subreport where you are showing this data. Because first it will be evaluated then it canhave the data to show.
jawadhashmi at 2007-11-9 14:11:33 >
# 2 Re: Formula to create comma separated string
Thax for reply
but I have single Colum and value in this colum is different.
I want to display this colum values into comma separated.

E.g. Column name "s_FirstName"

s_FirstName
------------------
Amit
Sumeet
Rakesh
Mukesh

I want this value of colum "s_FirstName" to be comma separated in report header.
like Amit, Sumeet, Rakesh, Mukesh etc...
kidly help me to write formula.

Regards
Amit Joshi
amit_pjoshi at 2007-11-9 14:12:43 >
# 3 Re: Formula to create comma separated string
join({Your_field},",")
ssakkerm at 2007-11-9 14:13:44 >
# 4 Re: Formula to create comma separated string
The way how to solve a such issue was explained several times on this forum, the last time was about 1 week ago.
:wave:
SvB_NY at 2007-11-9 14:14:38 >
# 5 Re: Formula to create comma separated string
Create a sub report and put it before the section where you want to show the names.

In the subreport lets call it concat_names

create a shared stringvar names := "";

in the detail section of the concat_names subreport put a formula and do as in it

shared stringvar names ;
if Length(names) > 0 Then
names := names + ", " + {s_FirstName};
else
names := {s_FirstName};

now go to the main report where you want to show the data create a formula named show_names
and simply write
shared stringvar names;

Keep in mind to place the concat_names subreport before the section where you want to show the names.
jawadhashmi at 2007-11-9 14:15:37 >
# 6 Re: Formula to create comma separated string
Thax. v much

I 'd what u have written.
but the values are coming in new lines not is single row.
--------------------
e.g.

Name:- Amit,
Sumeet,
Mukesh,
Rakesh
---------------------

I want to display comma separated values in single row..

--------------------
e.g.

Name:- Amit, Sumeet, Mukesh, Rakesh..... etc.
--------------------

Regards
Amit Joshi
amit_pjoshi at 2007-11-9 14:16:37 >
# 7 Re: Formula to create comma separated string
check the attached file
jawadhashmi at 2007-11-9 14:17:44 >
# 8 Re: Formula to create comma separated string
thank's alot.
my problem has been solved with the help of report u have given.
:)

Regards
Amit Joshi
amit_pjoshi at 2007-11-9 14:18:47 >