Page 1 of 1

Master Detail Driving me nuts

Posted: Thu Jan 21, 2010 8:27 am
by rhartzog
I have three tables/datasources and the keys are of type uniqueidentifier. I pull in the first table and set the databand1 to it, displaying an employee name. I pull in the second table as its own datasource, create a new relation with the first table as the parent. I then use a second data band and use databand1 as the master, and set the relationship to the one created. At this point everything works fine. Each employee shows it's child records. Here is where it fails me. I pull in the third table as its own datasource and set up a new relationship with the second table as the parent. I use a new databand below the second and set it's master to databand2 with the new relationship set as well. When I display it comes up blank. I do not understand what the problem is. In fact, if I remove the third databand from the report but leave the third datasource in the dictionary it still won't show anything. I have to remove the third datasource in order for it to successfully show the single level master detail again. It is a very simple two deep master detail display. Any suggestions would be greatly appreciated.

Master Detail Driving me nuts

Posted: Thu Jan 21, 2010 10:27 am
by Edward
Hi

The problem here is connected with "PrintIfDetailEmpty" property of the DataBand. That property hides masterband if there is no detail bands in it.

Just set that property in true for MasterDataBand and DetailDataBand as in fact they are master databands in your master-detail-subdetail report.

Thank you.

Master Detail Driving me nuts

Posted: Thu Jan 21, 2010 10:51 am
by rhartzog
Thank you Edward, I believe what you are saying is I should have:

DataBand1:
Datasource = Table1
Relation = None
Master Component = None
Print if detail empty = True

DataBand2:
DataSource = Table2
Relation = Table1Table2Relation
Master Component = DataBand1
Print if detail empty = True

DataBand3:
DataSource = Table3
Relation = Table2Table3Relation
Master Component = DataBand2
Print if detail empty = False


When I change the Print if detail empty setting to true on both databand1 and databand2 the report only prints Databand1 even though there is certainly detail for databand2 and 3. If I remove the relationship between table 3 and 2 it prints databand1 and databand2 as expected.

******EDIT******
I fixed the issue I was having and it was user error. When creating the second relationship (Table 2 to Table 3) I was only renaming the Name and Alias fields, but not the Name In Source field. Because of this, both relationships were defaulting to "Relation". It was not giving me any error message, but instead the report would just not render.

Master Detail Driving me nuts

Posted: Thu Jan 21, 2010 12:10 pm
by Edward
Hi

Thank you for this feedback.