1. Roland Smith
  2. PowerBuilder
  3. Monday, 16 September 2019

PB 12.5

We have a global function that is called which finds SSN columns on a DataWindow and applies an editmask if the user doesn't have the proper permissions to see SSN.

Now I am trying to extend this to nested reports.

I have a free form DataWindow that has several nested reports. The SSN on the main DataWindow is being masked as expected. I added code which lists all the nested reports which works correctly.

The problem is that GetChild is not working. If it were working, I would loop through the columns and apply the editmask the same way I am already doing for the main DataWindow.

 

I was hoping to not have to modify the nested DataWindow itself to check permissions in the editmask expression.

 

Miguel Leeuwe Accepted Answer Pending Moderation
0
Votes
Undo

In the past I solved this problem by "temporarily" changing the nested dw's type to be of type "5" (if I remember well), using Modify().

Modify("Datawindow.Processing=5") then do the GetChild()

After finishing what you're doing changing it back to what it was.

 

Comment
There are no comments made yet.
  1. Tuesday, 17 September 2019
  2. PowerBuilder
  3. # 1
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Great tip Ronnie! 

Comment
There are no comments made yet.
  1. Monday, 16 September 2019
  2. PowerBuilder
  3. # 2
Ronnie Po Accepted Answer Pending Moderation
0
Votes
Undo

I've been able to work around the getchild() limitation with the following technique:

 

DWObject ldwo_nested

ldwo_nested = dw_1.object.nested_report

 

 

 

Comment
There are no comments made yet.
  1. Monday, 16 September 2019
  2. PowerBuilder
  3. # 3
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi Roland;

    The GetChild() command only works from parent DWO's that are "Composite" in design. Nested parent DWO's are not supported (don't ask me why as this restriction should have been addressed by PowerSoft and Sybase a long time ago IMHO).

Regards ... Chris

Comment
Hi Chris,

I think the reason for the restriction is, that a nested report (child) in a "normal" datawindow is not distinct. Remember that the child contains not only the design information but also the data. For each row there is a separate instance that contains its own data.

In a composite datawindow is only one row so there is only one instance for each report.

Regards .... René
  1. René Ullrich
  2. Tuesday, 17 September 2019
Hi René;

I am pretty sure that its just because that feature was not properly finished. A DDDW is a nested child within a parent DWO. Another DWO within a nested DWO should not be a problem. Especially, where Ronnie's code works to get the DW Child, the GetChild() could just to the same internally.

Regards ... Chris
  1. Chris Pollach
  2. Tuesday, 17 September 2019
There are no comments made yet.
  1. Monday, 16 September 2019
  2. PowerBuilder
  3. # 4
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.