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

One to one vs. one to many in same report

Status
Not open for further replies.
Jul 13, 2002
36
US
I am building a report which includes fields from a static table which has a one-to-one relationship with a patient demographics table. These fields are in section A with an equal join. In section B, I need to import fields where the tables have a one-to-many relationship with the patient demographics table. I have tried ROJ on these with the patient table. What is happening is this: I put in a field such as a {weightlbs} field where there are multiple values. For every "hit" I get on weight, the static information repeats itself from Section A. I tried placing a Cross Tab in Section B but the "OK" button stays grey and won't let me use it. I don't want to use a sub-report I am going to show the problem in this illustration.

These are some of the static fields
{Pt_name} {numb_past_preg} {Est_date_delivery}

When I add field.....
{weight_lbs}, Above Information repeats for every Wt. Technonurse-Spokane
 
Create a new group based on the distinctive key in the weight table and put this group inside the patient name group. Link the tables with a left outer join. Then place the weight fields like {weight_lbs} in this second group. Each weight will show only once.

A caution. Do not create any summaries, as they will count and total all the duplicates even though they are not showing.
 
I am a little confused about Infobabe's suggestion. Are you suggesting a concantenation of the two groups within the details section of the report? I tried that and it didn't work.

This is what I ended up doing. I had a clean differentiation in the report lay-out between fields which are static and those which have the one-to-many relationship. So I placed the static fields into the report header and the one-to-many items into the details section. Technonurse-Spokane
 
TechnoNurse.

Details A is designed to print as often as Details B.

You solution will work as long as you only have one patient in the report. If you have more than one patient, Group your report by patient and put the patient fields in the Group Header (Not Details A) and then put the "Many" fields in the details section. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
That is exactly what I ended up doing....putting the one-to-one fields in the header and the one-to-many in the details. Thanks for your support. Technonurse-Spokane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top