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.
Hi Aron;
Just a Thought: May I suggest checking to see if their is an array of data first ...
Any ls_data[]
la_data = dw_1.Object.d_nested.object.data
IF UpperBound (la_data) > 0 THEN
la_any = dw_1.Object.d_nested[ll_loop].object.data
...
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aron;
The idea here is that you were trying to access (subscript) a NULL array. Since each of the DWO's buffers are an array, transferring a null array to the variable should not cause it to crash. Then the key is to see if the variable is a null array (ie: upperbound = 0) and then continue (subscript) the DWO's buffer if indeed data is present.
HTH
Regards ... Chris
Hey, the US guys should thank us for burning the White House down in the war of 1812 (Burning of Washington - Wikipedia, the free encyclopedia ... an example of where the US actually lost a war). Now Mr Obama has some new updated "digs" to work from C/O us.
PS: Have you hugged you DataWindow today?
Hi,
It might be trial and error here, these things can be tricky.
Maybe there is no dw_1.Object.d_nested.Object ? Have you tried IsNull or IsValid?
>> dw_1.Object.d_nested.Object.data that causes the crash
If you don't find a property; and it might not be very elegant, but a systemerror is not a crash and you can capture it locally using a try catch in the loop and continue.
Ben
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.