Does anybody use composite datawindows?
--
Thomas Gagne
Look under GetChild().
I've done what you're talking about. You need to name the reports
when you make the composit dw. You can then use those names with
GetChild() to get a handle to the individual reports. Then simply
do a retrieve for each of the reports that have arguments before
doing the retrieve on the composit.
DataWindowChild dwc_nest1, dwc_nest2
dw_composit.getChild("report_name1", dwc_nest1)
dw_composit.getChild("report_name2", dwc_nest2)
dwc_nest1.settransobject(sqlca)
dwc_nest2.settransobject(sqlca)
dwc_nest1.retrieve(arg1, arg2)
dwc_nest2.retrieve(arg3)
dw_composit.retrieve()
HTH
Roger
Yep. Actually, this 'feature' is listed as a one-line tip somewhere in the
documentation. You shoulda seen what one of my colleagues went through to get
a report to work when he had the unit sizes on nested reports different from
the composite 'master' report. Impressed the hell out of me that he got it to
work.
>2) I name the reports and then use getchild and retrieve the children.
>Code example follows, and it looks right but FAILS. I get a request to the
>screen for retrieval arguments when I do the getchild function???? It then
>gives a GPF. HELP??? They need some examples...
>
>All I want is to pass a single argument to every dw in the nested report...
>
>Ed
>------------------
>int rc
>string user_view
>DataWindowChild ch1,ch2,ch3
>user_view="SYBASE"
>
>rc = dw_sheet.GetChild( "rpt1" ,ch1)
>if rc = -1 then MessageBox("Error","No Child Window")
>rc = dw_sheet.GetChild("rpt2",ch2)
>if rc = -1 then MessageBox("Error","No Child Window")
>rc = dw_sheet.GetChild("rpt3",ch3)
>if rc = -1 then MessageBox("Error","No Child Window")
>
>// Gets child 2 and three at this stage
>ch1.SetTransObject(sqlca)
>ch2.SetTransObject(sqlca)
>ch3.SetTransObject(sqlca)
>ch1.Retrieve( user_view )
>ch2.Retrieve(user_view)
>ch3.Retrieve(user_view)
>
More importantly, this is the hard way. Try a right-click on the body of the
composite 'master' report. One of the selections will be 'retrieval
arguments.' Here, all of the retrieval arguments to be used by the nested
subreports. It does'nt matter if each report does not use ALL of the
specified retrieval arguments.
On each nested report, repeat the right click. Again you will be shown a
selection to choose retrieval arguments. When you assign a retrieval argument
for the nested subreport, use the appropriate argument that you specified when
you built the composite report arguments.
Hope this works for you,
Richard Gillespie
_______________________________________________
These Comments are MINE!. MINE! MINE! MINE!. |
They certainly do not reflect the beliefs of |
the organization with which I am employed; |
anyone who knows me would be among the |
first to agree! |
Return Address rgill...@pepco.com |
______________________________________________|
Ed
------------------
int rc
string user_view
DataWindowChild ch1,ch2,ch3
user_view="SYBASE"
rc = dw_sheet.GetChild( "rpt1" ,ch1)
if rc = -1 then MessageBox("Error","No Child Window")
rc = dw_sheet.GetChild("rpt2",ch2)
if rc = -1 then MessageBox("Error","No Child Window")
rc = dw_sheet.GetChild("rpt3",ch3)
if rc = -1 then MessageBox("Error","No Child Window")
// Gets child 2 and three at this stage
ch1.SetTransObject(sqlca)
ch2.SetTransObject(sqlca)
ch3.SetTransObject(sqlca)
ch1.Retrieve( user_view )
ch2.Retrieve(user_view)
ch3.Retrieve(user_view)
--
Edward Barlow eba...@pipeline.com
Check out My Sybase Library: http://sybase.pnl.gov:2080/Sybase/barlow/
Commercial Sybase Tools Forthcoming
Ya, this is true, but it kinda makes sense...
>2) I name the reports and then use getchild and retrieve the children.
>Code example follows, and it looks right but FAILS. I get a request to
the
>screen for retrieval arguments when I do the getchild function???? It
then
>gives a GPF. HELP??? They need some examples...
Don't use getchild. Instead open your composite data window, right
mouse click on the datawindow there is an item called Retrieval
Arguements. These are place holders for the child datawindow retrieval
arguments. Works as all retrieval argument boxes work.
Next select a child datawindow, right mouse click. On the menu there
is an item called Retrieval Arguments. Match the retrieval arguements
for the child with ones you just created for the parent.
Next get rid of all of your get child code. And retrieve your parent
datawindow with the arguements. Done...