creating a comma separated string

sanand

New member
Local time
Today, 07:21
Joined
Jun 25, 2009
Messages
5
Hi,

I have an access query that gets COUNT of CONTACT NUMBERS as per the ID column. The same details are displayed on the crystal report. I now want to add another column to the crystal report that should give me the actual CONTACT NUMBERS equal to the COUNT thats been displayed. these CONTACT NUMBERS should come on the report in the comma separated format.

Will this be done on the report or database side.
Any sugestions as to how can this be done.
please reply ASAP.

Thanks
 
Hi,

I have an access query that gets COUNT of CONTACT NUMBERS as per the ID column. The same details are displayed on the crystal report. I now want to add another column to the crystal report that should give me the actual CONTACT NUMBERS equal to the COUNT thats been displayed. these CONTACT NUMBERS should come on the report in the comma separated format.

Will this be done on the report or database side.
Any sugestions as to how can this be done.
please reply ASAP.

Thanks

You would need to create a custom function to go through a recordset and build that string. You might just want to build that function in Access (because you could use this one here) and then include that as part of your Access query so that Crystal can access it.
 
Try creating a formula that looks a bit like this
table.contactnumber+","+table.count
 
Try creating a formula that looks a bit like this
table.contactnumber+","+table.count

That answer is not correct in that it will not provide what the OP asked for. The OP asked for a way to have the counts AND a list of the ID's which made up that count. So, for example:

PHP:
Count          IDs
4              23,34,67,78
3              3,19,45
5              4,20,21,22,25
etc.
 
Sorry my misunderstanding
Insert a group on the count and then create three formulas:
//{@reset} for the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";
//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + {table.field}+",";
//{@display} to be placed in the group footer:
whileprintingrecords;
stringvar x;
trim(x);
Then suppress the group header and detail section.
 

Users who are viewing this thread

Back
Top Bottom