on ‎2014 Jul 03 2:33 PM
Okay I have a nested report, not a composite so GetChild is of no use, and I'd like to get to the data in the nested report. This kind of thing works very well:
For ll_loop = 1 to dw_1.RowCount()
la_any = dw_1.Object.d_nested[ll_loop].object.data
For ll_loop2 = 1 to UpperBound(la_any)
ll_ref = dw_validation.Object.dw_property[ll_loop].object.ref[ll_loop2]
Next
Next
The problem is when dw_1.Object.d_nested[ll_loop].object.data has no rows, a System Error occurs. I can't think of a way to check if there are any rows in advance. Long searches of the internet have turned up the following:
If long(dw_1.Object.d_nested[ll_loop].object.DataWindow.FirstRowOnPage) > 0
This always returns 0 for me and I know I have data in my first few nested reports
IsNull(dw_1.Object.d_nested[ll_loop])
This is never TRUE
IsValid(dw_1.Object.d_nested[ll_loop])
This is never FALSE
Anyone have any other ideas this is driving me crazy, it looks like it should be so simple!!!!
Thank you for any help.
Request clarification before answering.
Although you did not want to use a composite dw but just try to edit source of your dw and change the processing=0 to processing=5. Then you can use GetChild. See if that would work for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the suggestion but GetChild just doesn't work in situations like this it only returns the data in the first nested datawindow, i.e. the one for row 1 of the main report. I need to be able to see the data that belongs to each row, and the only way to do that is via dot notation, or at least not using GetChild. If only GetChild had a row number as an argument it would be very useful
Looks like there's no simple solution. Some options you could do:
1. Manually do a Select to verify if the nested report got some rows to retrieve i.e. select count(*) from table1 where <your conditions same with the retrieval argument on the nested report>
OR
2. Add a dummy row to your dw, i.e. use a UNION clause so that your nested report should contain at least 1 row in every master row.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.