cancel
Showing results for 
Search instead for 
Did you mean: 

Confused About Composite Datawindow - PB12.5

Former Member
0 Kudos

Greetings All,

I created a composite datawindow with 3 datawindows as: dw_remittance_composite_payment_report

dw_1 = dw_remittance_header2

     Arguments: sp_id

dw_2 = dw_remittance_header3

     Arguments: company, sp_id, payment_date

dw_3 = dw_remittance_line_items

     Arguments: company, sp_id, payment_date


I really have not idea how to get it to display with data in my application.  When I manually type in all of the values (via prompts), the composite datawindow seems to work fine.


1)  When I save dw_remittance_composite_payment_report I get an error message stating that the arguments are not configured ("Nest arguments are incorrectly specified").  I 'see' a place to type in something under 'Expression' and thought I could type in :sp_id or :company, but I keep getting a messages stating that the 'Expression is not valid'.


2) Where I want to use the report, I already have two datawindows as dw_1 (not related) and dw_2 for the composite report.  Do I have to change dw_2 to dw_10 so there is no conflict?


3) I read that I have to use GetChild to retrieve the datawindow, but I cannot find any example code to do that.  I figured it would be in the Appeon Demo, but while I can publish it, I cannot find the .pbw for the demo on my drive.


Thanks in advance for any and all pointers!!


Paul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you need to specify arguments for your nested dw you have to specify an datawindow expression like for computed columns. You can use dw functions or columns or computed fields from the master. If you want to specify a column you must not use ":"!

You can specify retrieval arguments for the master (= composite dw) in the general properties. This arguments you can specify in the expression for nested report like a column (also without ":")!

You can specify the names for the nested report in the composite dw as you want.

You only need to use GetChild to retrieve nested datawindows if you can't automatically retrieve the nested datawindow via the master. The easiest way would be to retrieve the composite dw (with values for definied arguments) and alle nested dws are automatically retrieved (expression results are here the arguments).

If you need to retrieve the nested by script here a short example:

DataWindowChild ldwc_detail

GetChild ("dw_1", ldwc_detail)  // "dw_1" is the name of the nested report in the composite dw

ldwc_detail.SetTransObject (SQLCA)

ldwc_detail.Retrieve ()

Former Member
0 Kudos
Former Member
0 Kudos

Thanks Rene, thanks Chris.

Chris, I did not comprehend your meaning.

Maybe I am doing this all the wrong way.  I posted a screenshot highlighting the second DW which has three arguments.

In the open event of the window I declare the DwC as shown here:

long rows

long newrow

long rtncode

dw_1.settransobject(sqlca)

dw_2.settransobject(sqlca)

dw_1.Retrieve(sp_id)

//moved to shared variables or maybe global

//DataWindowChild ldwc_head

//DataWindowChild ldwc_middle

//DataWindowChild ldwc_detail

dw_2.GetChild("dw_remittance_header2",ldwc_head)

dw_2.GetChild("dw_remittance_header3",ldwc_middle)

dw_2.GetChild("dw_remittance_line_items",ldwc_detail)

ldwc_head.SetTransObject(SQLCA)

ldwc_middle.SetTransObject(SQLCA)

ldwc_detail.SetTransObject(SQLCA)

//moved to clicked event in dw_1

//ldwc_head.Retrieve(sp_id)

//ldwc_middle.Retrieve(company, sp_id, affiliate_paid_date)

//ldwc_detail.Retrieve(company, sp_id, affiliate_paid_date)

And in the clicked event of dw_1, I have this code:

long clickedrow

//string sp_id

string company

datetime affiliate_paid_date

clickedrow = dw_1.getclickedrow()

if clickedrow > 0 then

  //sp_id = trim(dw_1.getitemstring(clickedrow, "voucher_dr_id"))

  company = trim(dw_1.getitemstring(clickedrow, "company"))

  affiliate_paid_date = dw_1.getitemdatetime(clickedrow, "affiliate_paid_date")

  ldwc_head.Retrieve(sp_id)

  ldwc_middle.Retrieve(company, sp_id, affiliate_paid_date)

  ldwc_detail.Retrieve(company, sp_id, affiliate_paid_date)

  dw_2.retrieve()

end if

But when I run window, I am prompted to type in all of the arguments as though the child datawindow was not instantiated or not retrieved.

Thanks Gentlemen for your help!!!!

Paul

Former Member
0 Kudos

You don't need to retrieve the child datawindows separately/individually. Here are the steps to do it:

1. Click on a blank space in your composite dw. Such that, you are not selecting any child dw or any object there. Then you will see the Retrieval Arguments for the composite in the Properties pane. You need to define all the arguments for all the child dw's there. In your example, you will need to define the sp_id, company and payment_date.

2. Click on each child datawindow. In the Properties pane (as in your screenshot, map the child dw arguments to the corresponding argument you defined in the composite. Do this for each child dw.

3. When retrieving, you just retrieve the composite. You don't need to retrieve the child dws. E.g. dw_composite.Retrieve(sp_id, company, payment_date). The child dw's will automatically retrieve.

HTH,

Neil

Former Member
0 Kudos

Thanks Neil!!

That was the crucial part that I was missing.  Once I clicked on 'nothing' I could see that I could type in the arguments.  Once I did that I could click on each datawindow and type in the argument and finally not get an error.

I tested it and it works great!!

Thank you, Neil, and thanks to Rene and Chris for pointing me in the right direction.

I really appreciated.

Thanks!!

Paul

Former Member
0 Kudos

   Yep, that's what I suggested in the 1st place. A lot easier than all that GetChild () stuff.  

Former Member
0 Kudos

I replied in the wrong place.  Sorry.

Right.  But Neil explained it in a way that this idiot could understand:

1. Click on a blank space in your composite dw. Such that, you are not selecting any child dw or any object there. Then you will see the Retrieval Arguments for the composite in the Properties pane. You need to define all the arguments for all the child dw's there. In your example, you will need to define the sp_id, company and payment_date.


Former Member
0 Kudos

Now you have been Ed-u-ma-cate-d young Padewan. 

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Paul;

  What I normally do is define all the Retrieval arguments that the child DWO's need in the parent Composite DW. Then, you can map each parent RA to the required RA in each child DWO in their properties pane.

  Once the RA mapping is done, you only need to use the one DC.Retrieve(arg1, arg2, ....) to pass all the various RA information into the composite DW grouping.

HTH

Regards ... Chris

Former Member
0 Kudos

Right.  But Neil explained it in a way that this idiot could understand:

1. Click on a blank space in your composite dw. Such that, you are not selecting any child dw or any object there. Then you will see the Retrieval Arguments for the composite in the Properties pane. You need to define all the arguments for all the child dw's there. In your example, you will need to define the sp_id, company and payment_date.



Former Member
0 Kudos

I thought that you were a PB expert!