Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Help adding details for group headers Post Reply Post New Topic
Author Message
wunof11
Newbie
Newbie
Avatar

Joined: 21 Aug 2011
Online Status: Offline
Posts: 11
Quote wunof11 Replybullet Topic: Help adding details for group headers
     Posted: 21 Aug 2011 at 2:40am

Hi,

 

I’m running Crystal Reports 11 under Win 7 Home Premium for a small clinic. I’m preparing several reports using 2 tables and so far everything was ok until…

Below is diagram of how the report is expected to come out.

 

Group 1           Visa Reference #

                        Group 2       Patient Reference; Patient Name; Address; Mobile

                                                Group 3      Case Reference; Date; Doctor

                                                                        Details Section   Test/Exam; Status (from table a)

                                                                                                Test/Exam; Status (from table b)

                                                                                                Test/ Exam; Status (from table c)

                        Group 2       Patient Reference; Patient Name; Address; Mobile

Group 3      Case Reference; Date; Doctor

                                                                        Details Section   Test/Exam; Status (from table a)

                                                                                                Test/Exam; Status (from table b)

                                                                                                Test/ Exam; Status (from table c)

Group 3      Case Reference; Date; Doctor

                                                                        Details Section   Test/Exam; Status (from table a)

                                                                                                Test/Exam; Status (from table b)

                                                                                                Test/ Exam; Status (from table c)

Group 1           Visa Reference #

                        Group 2       Patient Reference; Patient Name; Address; Mobile

                                                Group 3      Case Reference; Date; Doctor

                                                                        Details Section   Test/Exam; Status (from table a)

                                                                                                Test/Exam; Status (from table b)

                                                                                                Test/ Exam; Status (from table c

The report is grouped first by a visa reference number; the second level grouping from a linked table is the patient(s) reference/number and presented with the patient(s) name in the group section which maybe multiple patient’s per visa reference; the third level grouping is a case/visit reference and presented with additional details in the group section as well, and there will be multiple cases per patient.

Up to this point the data has come out ok. Visa reference and Case # are found in the same table and the patient reference in a second table.  The patient reference is the key that links the two tables together.

However, under each case number there will be data from 6 other tables, also linked via the case #, which I need to present as a group. When I bring in the fields from those tables it seems to filter out the previous data, i.e. instead of getting the data for each of several multiple cases under each patient, I only get the data for a single case under the patient and the other cases get filtered out. I’ve inserted the fields as details under the 3 level group, I’ve tried to get them under their own group, to no avail. What am I missing…. Thanks for your assitance

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Aug 2011 at 2:45am
click on the links to the 6 other tables and change the setting to an outer join.  You will have to play with left or right as I never figured out how CR determines that.
 
What it sounds like is happening is that the tables are Inner joined, which means that an entry for the patient needs to be in all the tables in order to get a result...which is probably not the case. 
 
An outer join is different.  If you have a list of patients outer joined to a test, you will get all the patients and where there is a match the test, otherwise a NULL. (this would be a left outer join as the patient table is to the left of the test, a right outer join would be all the test and which patients have taken them).
 
HTH
IP IP Logged
wunof11
Newbie
Newbie
Avatar

Joined: 21 Aug 2011
Online Status: Offline
Posts: 11
Quote wunof11 Replybullet Posted: 22 Aug 2011 at 2:47pm
Hi,

Yes I think you are correct. I had actually started to play around with the joins and had them as left outer joins. the data started to come in as I brought each field in...but woudln't you know it I had a server crash right after I got the 4 set in.

I'll come back to it in the morning.

Thanks for the input. Looks like you got me on the right track.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum