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

Formatting a Field

Status
Not open for further replies.

Jonathan212

IS-IT--Management
Oct 22, 2002
57
US
For surgical cases at my facility, there is sometimes one surgeon assigned to the case and at other times multiple surgeons are assigned to the case.
The names are appearing correctly on a report I have prepared, but in a vertical fashion.

For example:
Dr. Ben Casey
Dr. Marcus Welby

If there are multiple surgeons, I wish to have the names appear horizontally on one line.
For example:
Dr. Ben Casey, Dr. Marcus Welby

Can this be done via a formatting option (if yes, how) or by a formula (if so, how).

I am using CR10.
 
Group by the case and use the 3 formula method:

Group header formula:
whileprintingrecords;
stringvar Docs:=""

Details formula:

whileprintingrecords;
stringvar Docs;
if instr(Docs,{table.doc}) =0 then
Docs:=Docs+{table.doc}+","

Groupfooter (where you display):

whileprintingrecords;
stringvar Docs;
if len(docs) > 0 then
left(Docs,len(docs)-1)
else
""

Suppress the details and the groupheader sections.

-k
 
Thanks SynapseViper,

By using the details formua only, i was able to get the concatenation of the surgeons. However, they appeared as:

Ben Casey
Ben Casey, Marcus Welby

Ideally I just want the second line.

Would you clarify where I place the Group Header formula for me. Is it in the "section expert" and if so, what option?


 
You literally place the group header formula in the group header and suppress it. You should also suppress the detail section. The group footer formula is what is intended to display the desired results. Place it directly there. To suppress the group header and detail sections, right click on the gray area to the left of each section and click on "Suppress (No-Drill-Down)", or you could go into the section expert and select each and check suppress.

-LB
 
The field I want to display is in the detail field section of the report. I do not want to display the field in the group footer section. Does this make a difference?
 
Well, if I just do exactly as you indicate, all works fine.
It works. Thank you very very much. My problem was I had a subreport and I was doing what you told me to do outside of the subreport. When I did everything inside the subreport, it is perfect. Thank you for this wonderful solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top