Getting a reference to a DW in a nested report

I need to get a reference to a datawindow in a nested report.

The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
actual datawindow reference.

Please, no off the cuff answers (and flat out uninformed answers). 
TeamPS preferred.  Mail or post answer (preferably both) at
wmarshal@ca.coopers.com.

Wade Marshall
Coopers & Lybrand Consulting
Edmonton, AB, Canada.
0
clcstt
2/17/1998 9:36:19 PM
sybase.powerbuilder.datawindow 28057 articles. 5 followers. Follow

7 Replies
705 Views

Similar Articles

[PageSpeed] 57
Get it on Google Play
Get it on Apple App Store

Wade,

There are quite a few restrictions when dealing with nested DWs.
Is this a true nest (i.e., an instance per master row), or
a nest inside a composite? You can get a child handle on a nest
inside a composite, but not a true nest. With a true nest you
get (as you've observed) a dwobject pointer that allows you to
get and set data and attribute values inside the nest.

Can you give more details on what you're trying to do?

Sandy Barletta[TeamPS]

clcstt wrote:
> 
> I need to get a reference to a datawindow in a nested report.
> 
> The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> actual datawindow reference.
> 
> Please, no off the cuff answers (and flat out uninformed answers).
> TeamPS preferred.  Mail or post answer (preferably both) at
> wmarshal@ca.coopers.com.
> 
> Wade Marshall
> Coopers & Lybrand Consulting
> Edmonton, AB, Canada.
0
Sandra
2/17/1998 7:29:59 PM
Thanks for your reply.

As far as I can tell, this is not a true nest, it is simply a composite
datawindow with 4 other datawindows sitting inside of it.  Here is the
syntax I am using to reference them....

dw_1.Object.ndw_placeholder1
dw_1.Object.ndw_placeholder2
etc.

If I code the following...

any la_temp
la_temp = dw_1.Object.ndw_placeholder1

....and I debug it, the variable la_temp is of type dwObject with a
handle attribute.....

This code, however, gives me a runtime error....

datawindow ldw_temp
ldw_temp = dw_1.Object.ndw_placeholder1

I hope this the info you are looking for.  Thanks again.

Wade Marshall
Coopers & Lybrand Consulting
Edmonton, AB, Canada.
---------

Sandra Barletta[TeamPS] wrote:
> 
> Wade,
> 
> There are quite a few restrictions when dealing with nested DWs.
> Is this a true nest (i.e., an instance per master row), or
> a nest inside a composite? You can get a child handle on a nest
> inside a composite, but not a true nest. With a true nest you
> get (as you've observed) a dwobject pointer that allows you to
> get and set data and attribute values inside the nest.
> 
> Can you give more details on what you're trying to do?
> 
> Sandy Barletta[TeamPS]
> 
> clcstt wrote:
> >
> > I need to get a reference to a datawindow in a nested report.
> >
> > The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> > actual datawindow reference.
> >
> > Please, no off the cuff answers (and flat out uninformed answers).
> > TeamPS preferred.  Mail or post answer (preferably both) at
> > wmarshal@ca.coopers.com.
> >
> > Wade Marshall
> > Coopers & Lybrand Consulting
> > Edmonton, AB, Canada.
0
clcstt
2/18/1998 6:42:24 PM
OK, can you clarify what you need the datawindow pointer for? If
you want it because you're trying to, say, do a getitem/setitem/retrieve
type operation, you can do that with the child handle (since your
nests are in a composite). Example:

datawindowchild  ldwc_Nest

dw_1.GetChild('nest1', ldwc_Nest)

ll_Id = ldwc_Nest.GetItemNumber(1, 'id')

If you need it because you want get the result set into a  
datastore, then you can do that using dot notation. Example:

datastore	lds

lds = CREATE datastore
lds.DataObject = dw_1.Describe("nest1.dataobject")
lds.Object.Data = dw_1.Object.nest1.Object.Data

Into a DataWindow control that already exists:

dw_2.DataObject = dw_1.Describe("nest1.dataobject")
dw_2.Object.Data = dw_1.Object.nest1.Object.Data

A copy would be necessary because I've found that ShareData fails
when using a datawindowchild as the master and a datastore or a
DataWindow as the secondary (although the reverse works fine).

So I hope that helps. If it doesn't though, please provide more
information on what you want the datawindow pointer for.

Rgds,
Sandy Barletta[TeamPS]


clcstt wrote:
> 
> Thanks for your reply.
> 
> As far as I can tell, this is not a true nest, it is simply a composite
> datawindow with 4 other datawindows sitting inside of it.  Here is the
> syntax I am using to reference them....
> 
> dw_1.Object.ndw_placeholder1
> dw_1.Object.ndw_placeholder2
> etc.
> 
> If I code the following...
> 
> any la_temp
> la_temp = dw_1.Object.ndw_placeholder1
> 
> ...and I debug it, the variable la_temp is of type dwObject with a
> handle attribute.....
> 
> This code, however, gives me a runtime error....
> 
> datawindow ldw_temp
> ldw_temp = dw_1.Object.ndw_placeholder1
> 
> I hope this the info you are looking for.  Thanks again.
> 
> Wade Marshall
> Coopers & Lybrand Consulting
> Edmonton, AB, Canada.
> ---------
> 
> Sandra Barletta[TeamPS] wrote:
> >
> > Wade,
> >
> > There are quite a few restrictions when dealing with nested DWs.
> > Is this a true nest (i.e., an instance per master row), or
> > a nest inside a composite? You can get a child handle on a nest
> > inside a composite, but not a true nest. With a true nest you
> > get (as you've observed) a dwobject pointer that allows you to
> > get and set data and attribute values inside the nest.
> >
> > Can you give more details on what you're trying to do?
> >
> > Sandy Barletta[TeamPS]
> >
> > clcstt wrote:
> > >
> > > I need to get a reference to a datawindow in a nested report.
> > >
> > > The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> > > actual datawindow reference.
> > >
> > > Please, no off the cuff answers (and flat out uninformed answers).
> > > TeamPS preferred.  Mail or post answer (preferably both) at
> > > wmarshal@ca.coopers.com.
> > >
> > > Wade Marshall
> > > Coopers & Lybrand Consulting
> > > Edmonton, AB, Canada.
0
Sandra
2/19/1998 12:12:01 AM
Thanks for your response.

I want the datawindow pointer to copy rows into the nested object using
a RowsCopy().  After that, I want to pass that same datawindow pointer
into some other functions to do some special formatting before I send it
to the printer.

This is all part of what I hoped to be a generic, on the fly,
mini-report object that could take n-datawindows off an arbitrary
screen, put them into one composite report (so they will print on one
page).  Here are the basic steps I planned on doing...

1) Have a generic composite datawindow with a number of placeholder
datawindows inside of it
2) Switch the placeholder dataobjects to equal the dataobjects of the
datawindows on an arbitrary screen, resize them within the report, etc.
3) Copy the data from the screen datawindows to the placeholder
datawindows in the composite report
4) Make the DDDWs in the nested objects correlate with the screen DDDWs
(I already have a function that does this, takes a source DW and
destination DW)

For steps 3 and 4, I need the nested datawindow in a datawindow
variable.  Is it possible (it sounds like no) ?

Sandra Barletta[TeamPS] wrote:
> 
> OK, can you clarify what you need the datawindow pointer for? If
> you want it because you're trying to, say, do a getitem/setitem/retrieve
> type operation, you can do that with the child handle (since your
> nests are in a composite). Example:
> 
> datawindowchild  ldwc_Nest
> 
> dw_1.GetChild('nest1', ldwc_Nest)
> 
> ll_Id = ldwc_Nest.GetItemNumber(1, 'id')
> 
> If you need it because you want get the result set into a
> datastore, then you can do that using dot notation. Example:
> 
> datastore       lds
> 
> lds = CREATE datastore
> lds.DataObject = dw_1.Describe("nest1.dataobject")
> lds.Object.Data = dw_1.Object.nest1.Object.Data
> 
> Into a DataWindow control that already exists:
> 
> dw_2.DataObject = dw_1.Describe("nest1.dataobject")
> dw_2.Object.Data = dw_1.Object.nest1.Object.Data
> 
> A copy would be necessary because I've found that ShareData fails
> when using a datawindowchild as the master and a datastore or a
> DataWindow as the secondary (although the reverse works fine).
> 
> So I hope that helps. If it doesn't though, please provide more
> information on what you want the datawindow pointer for.
> 
> Rgds,
> Sandy Barletta[TeamPS]
> 
> clcstt wrote:
> >
> > Thanks for your reply.
> >
> > As far as I can tell, this is not a true nest, it is simply a composite
> > datawindow with 4 other datawindows sitting inside of it.  Here is the
> > syntax I am using to reference them....
> >
> > dw_1.Object.ndw_placeholder1
> > dw_1.Object.ndw_placeholder2
> > etc.
> >
> > If I code the following...
> >
> > any la_temp
> > la_temp = dw_1.Object.ndw_placeholder1
> >
> > ...and I debug it, the variable la_temp is of type dwObject with a
> > handle attribute.....
> >
> > This code, however, gives me a runtime error....
> >
> > datawindow ldw_temp
> > ldw_temp = dw_1.Object.ndw_placeholder1
> >
> > I hope this the info you are looking for.  Thanks again.
> >
> > Wade Marshall
> > Coopers & Lybrand Consulting
> > Edmonton, AB, Canada.
> > ---------
> >
> > Sandra Barletta[TeamPS] wrote:
> > >
> > > Wade,
> > >
> > > There are quite a few restrictions when dealing with nested DWs.
> > > Is this a true nest (i.e., an instance per master row), or
> > > a nest inside a composite? You can get a child handle on a nest
> > > inside a composite, but not a true nest. With a true nest you
> > > get (as you've observed) a dwobject pointer that allows you to
> > > get and set data and attribute values inside the nest.
> > >
> > > Can you give more details on what you're trying to do?
> > >
> > > Sandy Barletta[TeamPS]
> > >
> > > clcstt wrote:
> > > >
> > > > I need to get a reference to a datawindow in a nested report.
> > > >
> > > > The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> > > > actual datawindow reference.
> > > >
> > > > Please, no off the cuff answers (and flat out uninformed answers).
> > > > TeamPS preferred.  Mail or post answer (preferably both) at
> > > > wmarshal@ca.coopers.com.
> > > >
> > > > Wade Marshall
> > > > Coopers & Lybrand Consulting
> > > > Edmonton, AB, Canada.
0
clcstt
2/19/1998 5:56:56 PM
RowsCopy will work fine with a child datawindow handle. If your
intent is to have the nest be a mirror of the screen DW (which is
what it sounds like), then instead of RowsCopy you could simply do a 
ShareData, using the screen DW as the primary and the child datawindow
as the secondary. This type of sharing will work fine, although sharing
in the opposite direction will fail. For formatting, functions like
Modify
and Describe work fine for child datawindows. So it sounds like you're
in pretty good shape, at least thru step 3. Step 4, which involves a
nest
inside a nest is little bit trickier, but still doable. You can't use 
GetChild to get a child handle inside another child datawindow. But you
can use dot notation to get a dwobject pointer to the nested nest, and
then copy the data in from the screen DW. I.e.

datawindowchild	ldwc_Nest
dwobject 	ldwo_NestedNest

// Get child handle to composite (called 'nest1')
dw_1.GetChild('nest1', ldwc_Nest)

// Drive composite from source screen DW (dw_2)
dw_2.ShareData(ldwc_Nest)

// Get pointer to dropdown inside composite (called 'nest2')
ldwo_NestedNest = dw_1.Object.nest1.Object.nest2

// Copy data from dropdown in source screen DW (dw_2)
// to dropdown inside composite
ldwo_NestedNest.Object.Data = dw_2.Object.nest2.Object.Data

In my test, the above code worked like a champ.

Rgds,
Sandy Barletta[TeamPS]

clcstt wrote:
> 
> Thanks for your response.
> 
> I want the datawindow pointer to copy rows into the nested object using
> a RowsCopy().  After that, I want to pass that same datawindow pointer
> into some other functions to do some special formatting before I send it
> to the printer.
> 
> This is all part of what I hoped to be a generic, on the fly,
> mini-report object that could take n-datawindows off an arbitrary
> screen, put them into one composite report (so they will print on one
> page).  Here are the basic steps I planned on doing...
> 
> 1) Have a generic composite datawindow with a number of placeholder
> datawindows inside of it
> 2) Switch the placeholder dataobjects to equal the dataobjects of the
> datawindows on an arbitrary screen, resize them within the report, etc.
> 3) Copy the data from the screen datawindows to the placeholder
> datawindows in the composite report
> 4) Make the DDDWs in the nested objects correlate with the screen DDDWs
> (I already have a function that does this, takes a source DW and
> destination DW)
> 
> For steps 3 and 4, I need the nested datawindow in a datawindow
> variable.  Is it possible (it sounds like no) ?
> 
> Sandra Barletta[TeamPS] wrote:
> >
> > OK, can you clarify what you need the datawindow pointer for? If
> > you want it because you're trying to, say, do a getitem/setitem/retrieve
> > type operation, you can do that with the child handle (since your
> > nests are in a composite). Example:
> >
> > datawindowchild  ldwc_Nest
> >
> > dw_1.GetChild('nest1', ldwc_Nest)
> >
> > ll_Id = ldwc_Nest.GetItemNumber(1, 'id')
> >
> > If you need it because you want get the result set into a
> > datastore, then you can do that using dot notation. Example:
> >
> > datastore       lds
> >
> > lds = CREATE datastore
> > lds.DataObject = dw_1.Describe("nest1.dataobject")
> > lds.Object.Data = dw_1.Object.nest1.Object.Data
> >
> > Into a DataWindow control that already exists:
> >
> > dw_2.DataObject = dw_1.Describe("nest1.dataobject")
> > dw_2.Object.Data = dw_1.Object.nest1.Object.Data
> >
> > A copy would be necessary because I've found that ShareData fails
> > when using a datawindowchild as the master and a datastore or a
> > DataWindow as the secondary (although the reverse works fine).
> >
> > So I hope that helps. If it doesn't though, please provide more
> > information on what you want the datawindow pointer for.
> >
> > Rgds,
> > Sandy Barletta[TeamPS]
> >
> > clcstt wrote:
> > >
> > > Thanks for your reply.
> > >
> > > As far as I can tell, this is not a true nest, it is simply a composite
> > > datawindow with 4 other datawindows sitting inside of it.  Here is the
> > > syntax I am using to reference them....
> > >
> > > dw_1.Object.ndw_placeholder1
> > > dw_1.Object.ndw_placeholder2
> > > etc.
> > >
> > > If I code the following...
> > >
> > > any la_temp
> > > la_temp = dw_1.Object.ndw_placeholder1
> > >
> > > ...and I debug it, the variable la_temp is of type dwObject with a
> > > handle attribute.....
> > >
> > > This code, however, gives me a runtime error....
> > >
> > > datawindow ldw_temp
> > > ldw_temp = dw_1.Object.ndw_placeholder1
> > >
> > > I hope this the info you are looking for.  Thanks again.
> > >
> > > Wade Marshall
> > > Coopers & Lybrand Consulting
> > > Edmonton, AB, Canada.
> > > ---------
> > >
> > > Sandra Barletta[TeamPS] wrote:
> > > >
> > > > Wade,
> > > >
> > > > There are quite a few restrictions when dealing with nested DWs.
> > > > Is this a true nest (i.e., an instance per master row), or
> > > > a nest inside a composite? You can get a child handle on a nest
> > > > inside a composite, but not a true nest. With a true nest you
> > > > get (as you've observed) a dwobject pointer that allows you to
> > > > get and set data and attribute values inside the nest.
> > > >
> > > > Can you give more details on what you're trying to do?
> > > >
> > > > Sandy Barletta[TeamPS]
> > > >
> > > > clcstt wrote:
> > > > >
> > > > > I need to get a reference to a datawindow in a nested report.
> > > > >
> > > > > The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> > > > > actual datawindow reference.
> > > > >
> > > > > Please, no off the cuff answers (and flat out uninformed answers).
> > > > > TeamPS preferred.  Mail or post answer (preferably both) at
> > > > > wmarshal@ca.coopers.com.
> > > > >
> > > > > Wade Marshall
> > > > > Coopers & Lybrand Consulting
> > > > > Edmonton, AB, Canada.
0
Sandra
2/19/1998 8:49:54 PM
Ok, it took some time for it to sink in, but I didn't realize
datawindowchildren could be anything but dropdown lists.  Now I get it!

Thanks for your code (and continued attention).  I have been able to
implement a solution (yeah!).  However, it is still not as good as it
could be, because there is one more problem.

In your sample code....

// Copy data from dropdown in source screen DW (dw_2)
// to dropdown inside composite
 ldwo_NestedNest.Object.Data = dw_2.Object.nest2.Object.Data

....you know the name of the dropdown (nest2).  What if you don't?  Is
there any way to loop through a datawindow and get a list of dwObjects
that are DDDWs.

I know how to do this, but only if I am allowed to use GetChild().  With
a datawindowChild (as you have already stated), you cannot use
GetChild().

If I (or you) could figure this one out, my generic, on-the-fly,
printing service could be as good as I had hoped.

Sandra Barletta[TeamPS] wrote:
> 
> RowsCopy will work fine with a child datawindow handle. If your
> intent is to have the nest be a mirror of the screen DW (which is
> what it sounds like), then instead of RowsCopy you could simply do a
> ShareData, using the screen DW as the primary and the child datawindow
> as the secondary. This type of sharing will work fine, although sharing
> in the opposite direction will fail. For formatting, functions like
> Modify
> and Describe work fine for child datawindows. So it sounds like you're
> in pretty good shape, at least thru step 3. Step 4, which involves a
> nest
> inside a nest is little bit trickier, but still doable. You can't use
> GetChild to get a child handle inside another child datawindow. But you
> can use dot notation to get a dwobject pointer to the nested nest, and
> then copy the data in from the screen DW. I.e.
> 
> datawindowchild ldwc_Nest
> dwobject        ldwo_NestedNest
> 
> // Get child handle to composite (called 'nest1')
> dw_1.GetChild('nest1', ldwc_Nest)
> 
> // Drive composite from source screen DW (dw_2)
> dw_2.ShareData(ldwc_Nest)
> 
> // Get pointer to dropdown inside composite (called 'nest2')
> ldwo_NestedNest = dw_1.Object.nest1.Object.nest2
> 
> // Copy data from dropdown in source screen DW (dw_2)
> // to dropdown inside composite
> ldwo_NestedNest.Object.Data = dw_2.Object.nest2.Object.Data
> 
> In my test, the above code worked like a champ.
> 
> Rgds,
> Sandy Barletta[TeamPS]
> 
> clcstt wrote:
> >
> > Thanks for your response.
> >
> > I want the datawindow pointer to copy rows into the nested object using
> > a RowsCopy().  After that, I want to pass that same datawindow pointer
> > into some other functions to do some special formatting before I send it
> > to the printer.
> >
> > This is all part of what I hoped to be a generic, on the fly,
> > mini-report object that could take n-datawindows off an arbitrary
> > screen, put them into one composite report (so they will print on one
> > page).  Here are the basic steps I planned on doing...
> >
> > 1) Have a generic composite datawindow with a number of placeholder
> > datawindows inside of it
> > 2) Switch the placeholder dataobjects to equal the dataobjects of the
> > datawindows on an arbitrary screen, resize them within the report, etc.
> > 3) Copy the data from the screen datawindows to the placeholder
> > datawindows in the composite report
> > 4) Make the DDDWs in the nested objects correlate with the screen DDDWs
> > (I already have a function that does this, takes a source DW and
> > destination DW)
> >
> > For steps 3 and 4, I need the nested datawindow in a datawindow
> > variable.  Is it possible (it sounds like no) ?
> >
> > Sandra Barletta[TeamPS] wrote:
> > >
> > > OK, can you clarify what you need the datawindow pointer for? If
> > > you want it because you're trying to, say, do a getitem/setitem/retrieve
> > > type operation, you can do that with the child handle (since your
> > > nests are in a composite). Example:
> > >
> > > datawindowchild  ldwc_Nest
> > >
> > > dw_1.GetChild('nest1', ldwc_Nest)
> > >
> > > ll_Id = ldwc_Nest.GetItemNumber(1, 'id')
> > >
> > > If you need it because you want get the result set into a
> > > datastore, then you can do that using dot notation. Example:
> > >
> > > datastore       lds
> > >
> > > lds = CREATE datastore
> > > lds.DataObject = dw_1.Describe("nest1.dataobject")
> > > lds.Object.Data = dw_1.Object.nest1.Object.Data
> > >
> > > Into a DataWindow control that already exists:
> > >
> > > dw_2.DataObject = dw_1.Describe("nest1.dataobject")
> > > dw_2.Object.Data = dw_1.Object.nest1.Object.Data
> > >
> > > A copy would be necessary because I've found that ShareData fails
> > > when using a datawindowchild as the master and a datastore or a
> > > DataWindow as the secondary (although the reverse works fine).
> > >
> > > So I hope that helps. If it doesn't though, please provide more
> > > information on what you want the datawindow pointer for.
> > >
> > > Rgds,
> > > Sandy Barletta[TeamPS]
> > >
> > > clcstt wrote:
> > > >
> > > > Thanks for your reply.
> > > >
> > > > As far as I can tell, this is not a true nest, it is simply a composite
> > > > datawindow with 4 other datawindows sitting inside of it.  Here is the
> > > > syntax I am using to reference them....
> > > >
> > > > dw_1.Object.ndw_placeholder1
> > > > dw_1.Object.ndw_placeholder2
> > > > etc.
> > > >
> > > > If I code the following...
> > > >
> > > > any la_temp
> > > > la_temp = dw_1.Object.ndw_placeholder1
> > > >
> > > > ...and I debug it, the variable la_temp is of type dwObject with a
> > > > handle attribute.....
> > > >
> > > > This code, however, gives me a runtime error....
> > > >
> > > > datawindow ldw_temp
> > > > ldw_temp = dw_1.Object.ndw_placeholder1
> > > >
> > > > I hope this the info you are looking for.  Thanks again.
> > > >
> > > > Wade Marshall
> > > > Coopers & Lybrand Consulting
> > > > Edmonton, AB, Canada.
> > > > ---------
> > > >
> > > > Sandra Barletta[TeamPS] wrote:
> > > > >
> > > > > Wade,
> > > > >
> > > > > There are quite a few restrictions when dealing with nested DWs.
> > > > > Is this a true nest (i.e., an instance per master row), or
> > > > > a nest inside a composite? You can get a child handle on a nest
> > > > > inside a composite, but not a true nest. With a true nest you
> > > > > get (as you've observed) a dwobject pointer that allows you to
> > > > > get and set data and attribute values inside the nest.
> > > > >
> > > > > Can you give more details on what you're trying to do?
> > > > >
> > > > > Sandy Barletta[TeamPS]
> > > > >
> > > > > clcstt wrote:
> > > > > >
> > > > > > I need to get a reference to a datawindow in a nested report.
> > > > > >
> > > > > > The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> > > > > > actual datawindow reference.
> > > > > >
> > > > > > Please, no off the cuff answers (and flat out uninformed answers).
> > > > > > TeamPS preferred.  Mail or post answer (preferably both) at
> > > > > > wmarshal@ca.coopers.com.
> > > > > >
> > > > > > Wade Marshall
> > > > > > Coopers & Lybrand Consulting
> > > > > > Edmonton, AB, Canada.
0
clcstt
2/20/1998 7:52:04 PM
>>Is
there any way to loop through a datawindow and get a list of dwObjects
that are DDDWs.<<

Not using a dwObject variable. Unfortunately, when using dot object
notation, you cannot pass an object name as a string. So I'm stumped
on how to make this last piece truly generic. If I come up with any
approaches, I'll let you know.

Rgds,
Sandy Barletta[TeamPS]


clcstt wrote:
> 
> Ok, it took some time for it to sink in, but I didn't realize
> datawindowchildren could be anything but dropdown lists.  Now I get it!
> 
> Thanks for your code (and continued attention).  I have been able to
> implement a solution (yeah!).  However, it is still not as good as it
> could be, because there is one more problem.
> 
> In your sample code....
> 
> // Copy data from dropdown in source screen DW (dw_2)
> // to dropdown inside composite
>  ldwo_NestedNest.Object.Data = dw_2.Object.nest2.Object.Data
> 
> ...you know the name of the dropdown (nest2).  What if you don't?  Is
> there any way to loop through a datawindow and get a list of dwObjects
> that are DDDWs.
> 
> I know how to do this, but only if I am allowed to use GetChild().  With
> a datawindowChild (as you have already stated), you cannot use
> GetChild().
> 
> If I (or you) could figure this one out, my generic, on-the-fly,
> printing service could be as good as I had hoped.
> 
> Sandra Barletta[TeamPS] wrote:
> >
> > RowsCopy will work fine with a child datawindow handle. If your
> > intent is to have the nest be a mirror of the screen DW (which is
> > what it sounds like), then instead of RowsCopy you could simply do a
> > ShareData, using the screen DW as the primary and the child datawindow
> > as the secondary. This type of sharing will work fine, although sharing
> > in the opposite direction will fail. For formatting, functions like
> > Modify
> > and Describe work fine for child datawindows. So it sounds like you're
> > in pretty good shape, at least thru step 3. Step 4, which involves a
> > nest
> > inside a nest is little bit trickier, but still doable. You can't use
> > GetChild to get a child handle inside another child datawindow. But you
> > can use dot notation to get a dwobject pointer to the nested nest, and
> > then copy the data in from the screen DW. I.e.
> >
> > datawindowchild ldwc_Nest
> > dwobject        ldwo_NestedNest
> >
> > // Get child handle to composite (called 'nest1')
> > dw_1.GetChild('nest1', ldwc_Nest)
> >
> > // Drive composite from source screen DW (dw_2)
> > dw_2.ShareData(ldwc_Nest)
> >
> > // Get pointer to dropdown inside composite (called 'nest2')
> > ldwo_NestedNest = dw_1.Object.nest1.Object.nest2
> >
> > // Copy data from dropdown in source screen DW (dw_2)
> > // to dropdown inside composite
> > ldwo_NestedNest.Object.Data = dw_2.Object.nest2.Object.Data
> >
> > In my test, the above code worked like a champ.
> >
> > Rgds,
> > Sandy Barletta[TeamPS]
> >
> > clcstt wrote:
> > >
> > > Thanks for your response.
> > >
> > > I want the datawindow pointer to copy rows into the nested object using
> > > a RowsCopy().  After that, I want to pass that same datawindow pointer
> > > into some other functions to do some special formatting before I send it
> > > to the printer.
> > >
> > > This is all part of what I hoped to be a generic, on the fly,
> > > mini-report object that could take n-datawindows off an arbitrary
> > > screen, put them into one composite report (so they will print on one
> > > page).  Here are the basic steps I planned on doing...
> > >
> > > 1) Have a generic composite datawindow with a number of placeholder
> > > datawindows inside of it
> > > 2) Switch the placeholder dataobjects to equal the dataobjects of the
> > > datawindows on an arbitrary screen, resize them within the report, etc.
> > > 3) Copy the data from the screen datawindows to the placeholder
> > > datawindows in the composite report
> > > 4) Make the DDDWs in the nested objects correlate with the screen DDDWs
> > > (I already have a function that does this, takes a source DW and
> > > destination DW)
> > >
> > > For steps 3 and 4, I need the nested datawindow in a datawindow
> > > variable.  Is it possible (it sounds like no) ?
> > >
> > > Sandra Barletta[TeamPS] wrote:
> > > >
> > > > OK, can you clarify what you need the datawindow pointer for? If
> > > > you want it because you're trying to, say, do a getitem/setitem/retrieve
> > > > type operation, you can do that with the child handle (since your
> > > > nests are in a composite). Example:
> > > >
> > > > datawindowchild  ldwc_Nest
> > > >
> > > > dw_1.GetChild('nest1', ldwc_Nest)
> > > >
> > > > ll_Id = ldwc_Nest.GetItemNumber(1, 'id')
> > > >
> > > > If you need it because you want get the result set into a
> > > > datastore, then you can do that using dot notation. Example:
> > > >
> > > > datastore       lds
> > > >
> > > > lds = CREATE datastore
> > > > lds.DataObject = dw_1.Describe("nest1.dataobject")
> > > > lds.Object.Data = dw_1.Object.nest1.Object.Data
> > > >
> > > > Into a DataWindow control that already exists:
> > > >
> > > > dw_2.DataObject = dw_1.Describe("nest1.dataobject")
> > > > dw_2.Object.Data = dw_1.Object.nest1.Object.Data
> > > >
> > > > A copy would be necessary because I've found that ShareData fails
> > > > when using a datawindowchild as the master and a datastore or a
> > > > DataWindow as the secondary (although the reverse works fine).
> > > >
> > > > So I hope that helps. If it doesn't though, please provide more
> > > > information on what you want the datawindow pointer for.
> > > >
> > > > Rgds,
> > > > Sandy Barletta[TeamPS]
> > > >
> > > > clcstt wrote:
> > > > >
> > > > > Thanks for your reply.
> > > > >
> > > > > As far as I can tell, this is not a true nest, it is simply a composite
> > > > > datawindow with 4 other datawindows sitting inside of it.  Here is the
> > > > > syntax I am using to reference them....
> > > > >
> > > > > dw_1.Object.ndw_placeholder1
> > > > > dw_1.Object.ndw_placeholder2
> > > > > etc.
> > > > >
> > > > > If I code the following...
> > > > >
> > > > > any la_temp
> > > > > la_temp = dw_1.Object.ndw_placeholder1
> > > > >
> > > > > ...and I debug it, the variable la_temp is of type dwObject with a
> > > > > handle attribute.....
> > > > >
> > > > > This code, however, gives me a runtime error....
> > > > >
> > > > > datawindow ldw_temp
> > > > > ldw_temp = dw_1.Object.ndw_placeholder1
> > > > >
> > > > > I hope this the info you are looking for.  Thanks again.
> > > > >
> > > > > Wade Marshall
> > > > > Coopers & Lybrand Consulting
> > > > > Edmonton, AB, Canada.
> > > > > ---------
> > > > >
> > > > > Sandra Barletta[TeamPS] wrote:
> > > > > >
> > > > > > Wade,
> > > > > >
> > > > > > There are quite a few restrictions when dealing with nested DWs.
> > > > > > Is this a true nest (i.e., an instance per master row), or
> > > > > > a nest inside a composite? You can get a child handle on a nest
> > > > > > inside a composite, but not a true nest. With a true nest you
> > > > > > get (as you've observed) a dwobject pointer that allows you to
> > > > > > get and set data and attribute values inside the nest.
> > > > > >
> > > > > > Can you give more details on what you're trying to do?
> > > > > >
> > > > > > Sandy Barletta[TeamPS]
> > > > > >
> > > > > > clcstt wrote:
> > > > > > >
> > > > > > > I need to get a reference to a datawindow in a nested report.
> > > > > > >
> > > > > > > The format (dw_1.Object.rpt_1) gets me a dwObject reference.  I need an
> > > > > > > actual datawindow reference.
> > > > > > >
> > > > > > > Please, no off the cuff answers (and flat out uninformed answers).
> > > > > > > TeamPS preferred.  Mail or post answer (preferably both) at
> > > > > > > wmarshal@ca.coopers.com.
> > > > > > >
> > > > > > > Wade Marshall
> > > > > > > Coopers & Lybrand Consulting
> > > > > > > Edmonton, AB, Canada.
0
Sandra
2/20/1998 9:13:22 PM
Reply:

Similar Artilces:

How to get reference of a nested report in a dw?
Hi, I can use GetChild() method to get reference of report in a composite dw, but it failed(return -1) to get reference of nested report in a dw. How can i get reference of a nested report in a dw? Best Regards Johnson Here is the example in powerbuilder help : In this example, dw_1 is composite report, emp_state is the name of the nested report (datawindowchild) and state_child is the reference to this datawindowchild. DataWindowChild state_child integer rtncode rtncode = dw_1.GetChild('emp_state', state_child) IF rtncode = -1 THEN MessageBox( & ...

Urgent
Dear all, I'm using PB 6.5.1. I have a report with the following layout: Datawindow A contain Datawindow B, Datawindow B contain Datawindow C And I want to get a reference to Datawindow C. However, I tried to use GetChild() for Datawindow B. It retured -1. Thus, I also tried to get another Datawindow D which is nested in Datawindow A and no nested datawindow nested in it. Then, using GetChild is worked for this case. Am I missing something?? is there any other way round?? Any ideas or suggestion are welcome. Thanks in Advance. Best Regards, Andy Cheung ...

How can I get the reference of nested report in datawindow?
I will like to insert or modify data in nested report. I am using pb65. thanks. simon Simon, Reference the DataWindow's GetChild() function in the on-line help. HTH Mark DeRosa CPD simon wrote in message ... >I will like to insert or modify data in nested report. >I am using pb65. > >thanks. > >simon > > GetChild() can only get reference to dddw or to a report in a composite dw. it can't get reference to nested report. simon Use the dot notation. e.g. dw_1.Object.nt_cutomer.Object.Data = dw_customer.Object.D...

Reference a datawindow object (nested report) in a datawindow
Is it possible to reference a datawindow object in a datawindow? My scenario : I have a datawindow (composite) which holds another datawindow (nested report). This child datawindow has a OLE ActiveX object which I am trying to access from the window which holds the composite datawindow. The reason for this is because I need to access the ActiveX properties/functions after the composite datawindow have been retrieved. I've tried to get a reference to the child datawindow : //DataWindowChild dwc_activex dw1.getchild("dw_activex", dwc_activex) But as datawi...

How to get a child DW which contains a nested report of a Composite DW
Hi evryone, As PB cannot pass array retrieval argument to a composite DW (again a limitation of this poor dev tool), I need to retrieve manually each nested report. The problen is that one of the report contains a nested report tool (a third level) so the GetChild fails. As a result, there is no solution to make my report...except definitely drop PB If you use a database, can't you use temporary tables? Eric djmatti schreef: > Hi evryone, > > As PB cannot pass array retrieval argument to a composite DW > (again a limitation of this poor dev tool), I need t...

Get Reference to a nested datawindow
Hi all!... I have a little problem. I 'm using PB 8 and i need to get reference to a nested dw in a main dw. I have main datawindow, say dw_print, and a nested dw called dw_1. I'm trying to use dot syntax to get reference to nested datawindow dw_1, as i have read in old posts, but i take an error when applying this solution. In the old posts (relatively to PB 7) someone suggested to use this notation: ====================================================== dwcontrol.Object.nestedcontrolname { [row ] } .Object.dwcontrolname. & property { .property } { = value }...

Getting reference to nested reports
In PB 6.5, I can't do a GetChild to get access to a nested report, unless the DW is a Composite. Anyone know if that has changed in PB 7/8? The limitation is still there in 7.x and 8.0. -- <hopethishelps /> Roy Kiesler [TeamSybase] mySybase -- http://my.sybase.com http://www.exp.com/app/expertProfile?expertID=512231 "Jim Deerkoski" <jimdeer@hotmail.com> wrote in message news:E4m5U0rSBHA.210@forums.sybase.com... > In PB 6.5, I can't do a GetChild to get access to a nested report, unless > the DW is a Composite. > > Anyone know i...

getting the reference to a nested report
Hi, I have a tabular report (dw_list) with in the detail band a nested report (dw_nested). How can I get a reference to the nested report?? In a composite report one can do something like: datawindowchild ldwc dw_composite.getchild("nameNestedReport",ldwc) ldwc.SetTransObject(SQLCA) ldwc.insertrow(0) ... (or one can use sharedata to fill the nested report) However, if dw_list is not a composite report, dw_list.getchild("nameNestedReport",ldwc) DOES NOT WORK Is there a way to get the reference to the nested report?? Is the...

Getting a reference/handle to nesteds reports
I have a datawindow with several nested reports. I wish to get a handle to each of them and then try and export their contents to flat text. I thought <dw_control>.getchild(<'name of nested report'>,<datawindowchild variable>) would work, but it returns a -1. I'm using PB6.5, Windows2000 Pro. It is absolutely correct and must work. Check for the correctness of 'name of nested report'. Stuart_O'_Donnell wrote: > I have a datawindow with several nested reports. > > I wish to get a handle to each of them and then try...

how can i get a reference to a nested report?
TIA -- Savoulidis Iordanis Athens - Greece Look at the online help for the GetChild ( ) and datawindowchild object type. Savoulidis Iordanis wrote in message ... > >TIA >-- >Savoulidis Iordanis >Athens - Greece > > Getchild concerns only composite reports and dddws. Not what I need. I want to use RowsCopy() getting the rows from a NESTED report. You need to use dot notation. Suppose you have datawindowcontrol dw_1 which contains a nested report called d_report in the column col_report. dw_1.Object.col_report[1].Object.d_report dw_...

Getting a reference to a nested report object.
Hi guys, Anyone know a way of getting a reference to a nested report object. I almost want to do something like reportObjectDataType reportObject for i = rows to 0 step -1 reportObect = dw_main.GetItemReport('nested_report_name', rownumber) var = reportObject.value if var = 'this' then dw_main.deleteRow(i) end if next I realise that this won't work but hope it shows what I am trying to do... Could really use some help, it will be a mission to change the report to to return the rows I dont' want in the first place (belive it...

How to get data from nested report in datawindow?
I am using PB6.5 I used an nested report in current datawindow to get some data from database and I need to use data retrieved from nested report to compute in current window , and I do not how? Any help is apreciated... Mladen Mladen, If your nested report is on a composite DW and it doesn't itself have nested reports in it then you can use GetChild() to get a ref to the nested report then use the ref to call typical DW functions. Use those functions to grab the data and do what you want with it. If GetChild() doesn't work (because your DW doesn't match...

Get nested dw(report) column count ?
How to get nested dw(report) column count and set column property at runtime? In article <35BF164C.65FDC974@public.szonline.net>, zhangyuh@public.szonline.net says... > How to get nested dw(report) column count and set column property at > runtime? > > ll_count = Upperbound ( <DW Control Name>.Object.<Reportname>.Object.<col_name> ) <DW Control Name>.Object.<Reportname>.Object.<col_name>.<property_name> = somevalue -- John Strano [TeamPS] Have a heart, http://home.sprynet.com/sprynet/JCredit/eds_stry...

how to get data of a nested report in a basic dw
Hi, I want to get data of a nested report(dw_nested) in a basic datawindow named dw_1. I can use dot notation to get data of nested report such as dw_1.Object.dw_nested.Object.DataWindow.data , but if nested report name is from a variabls ls_nested but not a constant, i can't use dot notation such as dw_1.Object.ls_nested.Object.DataWindow.data to get data of nested report(ls_nested). I try to use Describe syntax dw_1.Describe(ls_nested +".Object.DataWindow.data") but not work. How can i do? Best Regards Johnson AFAIK - you can't. You have to use...

Web resources about - Getting a reference to a DW in a nested report - sybase.powerbuilder.datawindow

European Terrestrial Reference System 1989 - Wikipedia, the free encyclopedia
The European Terrestrial Reference System 1989 ( ETRS89 ) is a ECEF (Earth-Centered, Earth-Fixed) geodetic Cartesian reference frame , in which ...

New York Times Removes Reference to President Obama and Cable News
... — Noah Rothman (@NoahCRothman) December 18, 2015 The Times story was published Thursday, but by Friday morning, the reference to cable news ...

Reference Pricing tweak for Medicaid
Reference pricing is a common payment reform for commercial insurance. Common, non-urgent, deferrable procedures are prime candidates. Hip replacement ...

New Apple TV ads are clever reference to Six Colors design - Business Insider Deutschland
The new Apple TV ads are a reference to a crucial time in Apple history.

Donald Trump prompts Nazi references
Some conservatives and political commentators say the GOP frontrunner's rhetoric has crossed the line

Arrow: Easter Eggs and DC Comics References in "Brotherhood"
This was a weird week for Arrow, in terms of the crazy minutia we generally look for.There were a [...]

O’Malley References How Old Clinton And Sanders Are While Explaining His ISIS Strategy
O’Malley References How Old Clinton And Sanders Are While Explaining His ISIS Strategy

Now you can bookmark Google image searches for later reference
Normally, image searches on Google are ephemeral things and gone the moment you close the browser tab. However, a new feature on the search giant's ...

How To Get the References You Need For the Job You Really Want
How To Get the References You Need For the Job You Really Want

FORCE AWAKENS DC Pols rush to capitalize on 'Star Wars' references
FORCE AWAKENS DC Pols rush to capitalize on 'Star Wars' references

Resources last updated: 12/20/2015 10:05:13 AM