1. Roland Smith
  2. PowerBuilder
  3. Monday, 16 September 2019 15:37 PM UTC

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
  1. Tuesday, 17 September 2019 21:40 PM UTC
  2. PowerBuilder
  3. # 1

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
  1. Berka Frenfert
  2. Tuesday, 28 February 2023 13:45 PM UTC
Hi Miguel,

Thanks a lot it worked for me. btw this should be accepted answer.



Regards,

Berka
  1. Helpful 1
  1. Miguel Leeuwe
  2. Tuesday, 28 February 2023 14:44 PM UTC
Glad it worked!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 16 September 2019 19:39 PM UTC
  2. PowerBuilder
  3. # 2

Great tip Ronnie! 

Comment
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Monday, 16 September 2019 18:53 PM UTC
  2. PowerBuilder
  3. # 3

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.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 16 September 2019 15:44 PM UTC
  2. PowerBuilder
  3. # 4

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
  1. René Ullrich
  2. Tuesday, 17 September 2019 05:20 AM UTC
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. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 17 September 2019 13:53 PM UTC
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. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.