Crystal 2011 CONCATENATE rows' 'value INTO ONE STRING within a subreport

Posted on 2013-08-28
Medium Priority
Last Modified: 2013-09-12
I have a subreport where multiple rows can be returned for a  department_id which is passed from the main report.

I have the department name in the detail section of the subreport.

What I would like to do, is each time a row is read concatenate the department name seperated by commas for example:
DepartmentA, DepartmentB, DepartmentC....
instead of
Question by:cookiejar
  • 2
LVL 18

Expert Comment

ID: 39447258
What is your database type?

Author Comment

ID: 39447291
LVL 18

Expert Comment

ID: 39447352
I cannot help with Oracle. However if you search for "return comma separated values" you might find the right syntax and create a SLQExpression to get this data. This will allow you to avoid using subreport.

The other way ( with subreport) - you need to create a "whileprinting" formula  with a shared variable and append the department to the shared variable (in the details section ).
LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 39447682
Try this

In the main report report header
Shared StringVar DepartmentList;

In the subreport detail section
Shared StringVar DepartmentList;
DepartmentList := DepartmentList & ", " & {DepartmentField} ;

In the main report in a section after the subreport
Shared StringVar DepartmentList;


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
To export Lotus Notes to Outlook PST or Exchange and Domino Server files to Exchange Server or PST files with ease, go for Kernel for Lotus Notes to Outlook conversion tool. Through the video, you can watch the conversion process. A common user with…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question