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

creating an array/formula that will string together values 2

Status
Not open for further replies.

cf53bank

Technical User
Apr 6, 2005
3
US
I am working in Crystal 8.5.

I am trying to create an array/formula that strings together values for a field that appears in the details section. For example on the design window I have

group header 1 = {TABLE1.EMPLOYEE_NAME}
details = {TABLE2.COURSE}

When I run the report I see each employee name then a list of courses for each employee. I need to create an array/formula that will pull together each value listed for the COURSE field for each employee and place it in one spot.

So, my output would be somehting like: COURSE_A, COURSE_B, COURSE_C

Once I have the formula/array created I can then use it as a field to link on in my sub-report.

Thanks in advance for any suggestions that might be out there.


 
This should work:

// Formula @EmplCourses

WhilePrintingRecords;

StringVar Courses;

If Length(Courses) = 0 then
Courses:= {table.field} else
Courses:= Courses + ", " + {table.field}

MrBill
 
I don't think you'll be able to link by the formula result however. You might be able to set up the formula result as a shared variable and then use it for conditional suppression in an unlinked subreport.

Or, you could explain more specifically what you are trying to do with the report, as there might be an alternate approach to the problem.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top