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

Display multiple results on one line 1

Status
Not open for further replies.

BigDaddyE

MIS
Apr 29, 2010
27
US
I have a report that pulls in multiple diagnosis for a patient. I want to also list the disciplines which are also multiple. The problem is that the report lists the Disciplines again for every Diagnosis. I want to list the Disciplines once, and on one line.

THIS IS EWHAT I HAVE:
Pat_Name Pat_Diagnosis Pat_Discipline
John Doe
Stomach Ach
RN
PT
OT
Stubbed Toe
RN
PT
OT
Heart Attack
RN
PT
OT

THIS IS WHAT I WANT:
Pat_Name Pat_Diagnosis Pat_Discipline
John Doe RN, PT, OT
Stomach Ach
Stubbed Toe
Heart Attack

Any help????
 
Group on Pat_name.
Within this group, group on Pat_Diagnosis.
Hide the details line.

Bob Suruncle
 
I think you should group on Pat_name, and drag the group name to the group footer. Then create a formula and place it in the detail section and suppress it:

//{@accum}:
whileprintingrecords;
stringvar diag;
stringvar disc;
if not({table.pag_diagnosis} in diag) then
diag := diag + {table.pat_diagnosis}+chr(13);
if not({table.pat_discipline} in disc) then
disc := disc + {table.pat_discipline}+", ";

Add a reset formula to the group #1 header:

whileprintingrecords;
stringvar diag;
stringvar disc;
if not inrpeatedgroupheader then (
diag := "";
disc := ""
);

In the group footer, add these two formulas:

//{@displdiag}:
whileprintigrecords;
stringvar diag;

Format the above formula to "can grow" (format field->common tab->can grow).

//{@displdisc}:
whileprintigrecords;
stringvar disc;
left(disc, len(disc)-2)

Then suppress the group header and the details section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top