[dabo-users] Reports - one to many

Author: James Bull

Posted: 2011-12-28 at 19:10:10

Wondering if I could get some pointers.

I have tables setup as

Parent(person)

-ChildA(many: medications)

-ChildB(many: allergies)

The report I am trying to produce aims to have Parent details then below this 2 lists of childA and childB - to provide a summary report of medication one may be on and allergies.

My problem is as I understand it, reportwriter needs denormalized dataset - which to me means each 'row' contains all the same data with one unique element; so in the example dataset below the first 3 'rows' are unique on meds(and medpkid) and retain same allergy etc:

( {'meds': 'medication-test1', 'pkid': 21, 'allergy': 'penicillin-test', 'medid': 465, 'ptid': 465, 'medpkid': 217},

{'meds': 'medication-test2', 'pkid': 21, 'allergy': 'penicillin-test', 'medid': 465, 'ptid': 465, 'medpkid': 471},

{'meds': 'drug-test', 'pkid': 21, 'allergy': 'penicillin-test', 'medid': 465, 'ptid': 465, 'medpkid': 472}, {'meds': 'medication-test1', 'pkid': 240, 'allergy': 'sulphur-test', 'medid': 465, 'ptid': 465, 'medpkid': 217},

{'meds': 'medication-test2', 'pkid': 240, 'allergy': 'sulphur-test', 'medid': 465, 'ptid': 465, 'medpkid': 471},

{'meds': 'drug-test', 'pkid': 240, 'allergy': 'sulphur-test', 'medid': 465, 'ptid': 465, 'medpkid': 472} )

So in report I am trying to list for each unique person(ptid) a list allergies: pencillin,sulphur and list meds: medication-test1 etc, instead as the rw Cursor iterates over each element in tuple I have long list of allergies essentially repeated in current example for each unique medication.

Have tried grouping but still cannot achieve what I envisage.

What am I doing wrong? Any help would be most appreciated.

regards

james

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/B088D54E-9A44-4D3A-B439-EF418E82E69F@gmail.com

©2011 James Bull