newsgroups-index (beta)

Current group: dbase.reports

master-detail

master-detail  
Nico Oudshoorn
 Re: master-detail  
Marc Hamelin
 Re: master-detail  
Michael Nuwer [dBVIPS]
 Re: master-detail  
Nico Oudshoorn
 Re: master-detail  
Michael Nuwer [dBVIPS]
 Re: master-detail  
Jan Hoelterling
 Re: master-detail  
Nico Oudshoorn
From:Nico Oudshoorn
Subject:master-detail
Date:Thu, 9 Dec 2004 18:50:08 +0100
I have master-detail relaionship in my report.

this.OPDRACHT1 = new QUERY()
this.OPDRACHT1.parent = this
with (this.OPDRACHT1)
onOpen = class::OPDRACHT1_ONOPEN
left = 97.4229
top = 9.5
database = form.database1
sql = 'select * from "opdracht.dbf"'
active = true
endwith

with (this.OPDRACHT1.rowset)
indexName = "verhuurdatum"
endwith

this.OPDRACHTREGEL1 = new QUERY()
this.OPDRACHTREGEL1.parent = this
with (this.OPDRACHTREGEL1)
onOpen = class::OPDRACHTREGEL1_ONOPEN
left = 66.4354
top = 10.0
database = form.database1
sql = 'select * from "opdrachtregel.dbf"'
active = true
endwith

with (this.OPDRACHTREGEL1.rowset)
indexName = "opdrachtnr"
masterRowset = form.opdracht1.rowset
masterFields = "opdrachtnummer"
navigateByMaster = true
endwith

this.firstPageTemplate = this.form.pagetemplate1
this.form.pagetemplate1.nextPageTemplate = this.form.pagetemplate1
this.form.pagetemplate1.streamframe1.streamSource =
this.form.streamsource1
this.form.streamsource1.rowset = this.form.opdracht1.rowset

The problem i s that despite of opdracht has more than one detail record,
only one detailrecord is printed.

this.STREAMSOURCE1 = new STREAMSOURCE(this)
this.STREAMSOURCE1.GROUP1 = new GROUP(this.STREAMSOURCE1)
with (this.STREAMSOURCE1.GROUP1)
groupBy = "opdrachtnummer"
endwith

and

autoSort = false

Any suggestions or bypasses?

Nico Oudshoorn.
From:Marc Hamelin
Subject:Re: master-detail
Date:Thu, 9 Dec 2004 13:10:45 -0500
> this.form.streamsource1.rowset = this.form.opdracht1.rowset

Try this instead:

this.form.streamsource1.rowset = this.form.opdrachtregel1.rowset

I believe it's the detail rowset you want to stream, not the master rowset.
Hope this helps.

Marc Hamelin
From:Michael Nuwer [dBVIPS]
Subject:Re: master-detail
Date:Thu, 09 Dec 2004 14:56:01 -0500
Nico Oudshoorn wrote:

>
> Any suggestions or bypasses?

A few thoughts:

> with (this.OPDRACHT1.rowset)
> indexName = "verhuurdatum"
> endwith
> with (this.STREAMSOURCE1.GROUP1)
> groupBy = "opdrachtnummer"
> endwith

Is the field opdrachtnummer used as the index key for verhuurdatum or as
the first element in the index tag? In order of the groupby to work
properly, the primary sort order of the data must be by "opdrachtnummer"


> with (this.OPDRACHTREGEL1.rowset)
> navigateByMaster = true
> endwith

Is there a reason way you are using the navigateByMaster property? It
shouldn't be needed within a report and might be causing your problem.



--
Michael Nuwer
http://www.ChelseaData.ca/dLearn/
http://www.nuwermj.potsdam.edu/dSamples/
From:Nico Oudshoorn
Subject:Re: master-detail
Date:Fri, 10 Dec 2004 19:23:12 +0100
Opdracht now has the index opdrachtnummer. I filter out all the opdracht I
need by a cangetrow. I took away the navigatbymaster. The streamsource is
opdrachtregel. On the report I only get one opdracht with all his
opdrachtregel. With streamsource set to opdracht I get all the opdracht with
only one opdrachtregel each. Even if I don't use the cangetrow the results
are the same.

I did use navigatebymaster because in Help it says that master and detail
than operate as if it is one-table. That is also the reason why I in my
report streamsource set to opdracht (the master). Help says: Enabling a
linked-detail rowset's navigateMaster and navigateByMaster properties allows
master-detail rowsets to be navigated as though they were part of a single,
combined rowset

Nico Oudshoorn.


"Michael Nuwer [dBVIPS]" schreef in
bericht news:KZtjcni3EHA.1908@news-server...
> Nico Oudshoorn wrote:
>
>>
>> Any suggestions or bypasses?
>
> A few thoughts:
>
> > with (this.OPDRACHT1.rowset)
> > indexName = "verhuurdatum"
> > endwith
> > with (this.STREAMSOURCE1.GROUP1)
> > groupBy = "opdrachtnummer"
> > endwith
>
> Is the field opdrachtnummer used as the index key for verhuurdatum or as
> the first element in the index tag? In order of the groupby to work
> properly, the primary sort order of the data must be by "opdrachtnummer"
>
>
> > with (this.OPDRACHTREGEL1.rowset)
> > navigateByMaster = true
> > endwith
>
> Is there a reason way you are using the navigateByMaster property? It
> shouldn't be needed within a report and might be causing your problem.
>
>
>
> --
> Michael Nuwer
> http://www.ChelseaData.ca/dLearn/
> http://www.nuwermj.potsdam.edu/dSamples/
From:Michael Nuwer [dBVIPS]
Subject:Re: master-detail
Date:Sat, 11 Dec 2004 10:14:36 -0500
Nico Oudshoorn wrote:

> Opdracht now has the index opdrachtnummer.

This should correct.

> I filter out all the opdracht I
> need by a cangetrow.

This should be ok.

> I took away the navigatbymaster.

Good, it's not needed for reports. The Report engine will automatically
skip to the next record in the master table.

> The streamsource is
> opdrachtregel. On the report I only get one opdracht with all his
> opdrachtregel.

The streamsource should not be pointing to the child table.

> With streamsource set to opdracht I get all the opdracht with
> only one opdrachtregel each. Even if I don't use the cangetrow the results
> are the same.

This is be correct. And, given the information provided, the report
should be working when the streamsource is pointing to the master table.
If you continue to have problems, after closing and restarting dBASE
and recompiling the report file, please post your updated code and we
will take another look.

> I did use navigatebymaster because in Help it says that master and detail
> than operate as if it is one-table. That is also the reason why I in my
> report streamsource set to opdracht (the master). Help says: Enabling a
> linked-detail rowset's navigateMaster and navigateByMaster properties allows
> master-detail rowsets to be navigated as though they were part of a single,
> combined rowset

Perhaps the OLH should be edited with a note that this is not required
for reports. At my web site there is an example report that will show
you in detail how the report engine skips through a parent and child table.

http://www.nuwermj.potsdam.edu/dLearn/reporting/01Introduction.htm
See "Understanding the event model" -- EventOrder2
From:Jan Hoelterling
Subject:Re: master-detail
Date:Thu, 9 Dec 2004 12:13:45 -0600
Make sure that the rowset of the streamsource points to the detail rowset,
not the master. This is what drives the navigation.

HTH,

Jan
From:Nico Oudshoorn
Subject:Re: master-detail
Date:Thu, 9 Dec 2004 20:12:43 +0100
In case the streamsource points to the master the report prints 3 records
from opdracht (the master) and from the detail only one record.
In case I change the streamsource to opdrachtregel (the detail) than the
records from only one opdracht (the master) are printed.

Nico Oudshoorn.

"Jan Hoelterling" schreef in bericht
news:nAQQTuh3EHA.1088@news-server...
> Make sure that the rowset of the streamsource points to the detail rowset,
> not the master. This is what drives the navigation.
>
> HTH,
>
> Jan
>
>
   

Copyright © 2006 newsgroups-index   -   All rights reserved   -   Impressum