Master/Detail - Problem

MaBo

Member
I'm have a problem sing the master/detail -properties of the TOracleDataSet to solve a problem with Delphi5 and ReportBuilder.
I'm working withe one master and two detail - dataSets. It's depending on a special attribute in the master-dataSet, which detailSet should be opened.
I tried to code the AfterOpen- and AfterScroll-Event but the results haven't been satisfying.
This there any other opportunity ?

------------------
 
I think you should attempt to use the standard master/detail functionality of the TOracleDataSet. My first approach would be to keep both detail datasets opened at all times. The master field that defines which dataset should be opened, can be used in the where-clause of the detail datasets to effectively enable/disable the result set.

Let's assume that the master has a field 'id', and the detail datasets have a 'master_id' field taht links the detail records to this master record. Furthermore, you have an 'indicator' field in the master. If it contains the value '1', detail dataset 1 should contain records. If it is '2', detail dataset 2 should contain records. The where clauses of the 2 detail datasets could look like this:

Detail dataset 1:
where master_id = :id and :indicator = '1'

Detail dataset 2:
where master_id = :id and :indicator = '2'

Both detail datasets should have their MasterFields property set to 'id;indicator', and the DetailFields should be empty.

See the help topic of the Master property for more information (especially the 'Non-referential details' section).

------------------
Marco Kalter
Allround Automations
 
Back
Top