Click to See Complete Forum and Search --> : Return results seperates with commas


sparker
May 13th, 2009, 10:58 AM
Hi,

would anyone know how to formate a spacific set of data, that is returned in rows
and combind them in a single line seperated by commas.

Example, this is what I get from a single data set.

Colors
PMS1
PMS2
PMS3
PMS4

I would like to have:
Colors
PMS1, PMS2, PMS3, PMS4

and the number of returned results will vary some order will only have 2 colors and other
can have up to 6 or even 12.

Thanks

jggtz
May 13th, 2009, 12:50 PM
(Modify according to your needs)

To do that, you have to create 3 formulas:

The first one, let's call it @null:

whileprintingrecords;
stringvar names := "";

Place it in your GH section, it will return you null.



The second one, let's say @comma_field:

whileprintingrecords;
stringvar names;
names := names & ", " & {table.field};

Place it in your Detailes section which you can suppress; the formula will return you next:
, Jules, Christina, Paul


and the 3rd formula, let's call it @final (or whatever you like):

whileprintingrecords;
stringvar names;
Mid(names, 3);

Place it in your GF section.

sparker
May 13th, 2009, 03:31 PM
Great, I will give this a try, I will let you know how it goes in about 24hrs.
were are still building out our MRP system and required data sets.


TKY