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

Cumulative Text formula

Status
Not open for further replies.

Pudge

MIS
Nov 30, 2000
11
US
I am working with a report using Crystal Reports v9 from an SQL database.

I have two tables:

One is a care_map table. The other is a staff_table.

The care map table includes a key for the particular care map. Also included is a staff_id. There may be multiple staff_id’s for a given care map.

The staff table includes the staff_id and the name of the staff person.

What I need to be able to do is to develop a formula or some variable that will include in one text string all of the names of all staff who are associated with a particular care map key.

The count of staff associated with any given care map key will vary.

For example:

For Care map key 10, there may be 3 staff (Jane Doe, John Doe, Mary Doe)

Right now, I can list these individually in a details section. But what I need to do is to be able to develop one variable with one string that will include all the names (ie: Jane Doe, John Doe, Mary Doe).


This variable then can be used to replace a placeholder variable in a memo field in the group header.


Any suggestions.

Pudge

 
Try grouping by Care_Map, and then using a variable to concatenate the values to be displayed at the Care_Map group footer level:

Care Map Header Formula:
whileprintingrecords;
global Stringvar MyNames :="";

Details section Formula:
whileprintingrecords;
global Stringvar MyNames;
MyNames := MyNames +", " +{Staff.Name}

Core Map Footer Formula:
whileprintingrecords;
global Stringvar MyNames;
MyNames

-k kai@informeddatadecisions.com
 
synapsevampire or Pudge

Can you please clarify the steps when creating the formula for header, detail, and footer sections? This seems to be the solution for my problem right now but I have a hard time to figure how to create those formulas. Please advice. Thanks.

HP
 
All formulas are created the same way, insert->field object->formula field. Then just place the object in the proper section of the report to get the desired bahavior.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
dgillz

Thank you so much for your advice. Its works great!

HP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top