Now that I have done this all day , is there a way in VB SDK to delete an object within a data provider, based off of some condition, before the report refreshes
Little background, I have some objects that contains @prompts, and based off of some condition prior to me overriding those prompts using VB SDK, I might want to just delete the object that contains the @prompt. Can I do this? Or can I just disable that object before the refresh?
[quote:486aa78d9d=“Barry D. Beaton”]Now that I have done this all day , is there a way in VB SDK to delete an object within a data provider, based off of some condition, before the report refreshes
Little background, I have some objects that contains @prompts, and based off of some condition prior to me overriding those prompts using VB SDK, I might want to just delete the object that contains the @prompt. Can I do this? Or can I just disable that object before the refresh?
[/quote]
You would have to loop through the result objects and/or condition objects to search for the specific class name & object name, but it’s possible to delete objects on the fly. Sounds rather brute force, but yes it’s possible.
I created a simple report with two objects. I want to “loop through” and after finding the one (How?) I want to delete, delete it, then continue with the report refresh.
Can anyone push me in the right direction a little more.
[quote:fbcad71ec6=“Barry D. Beaton”]Can anyone push me in the right direction a little more.
[/quote]
Try looking at the code in this utility. It’s a utility that copies data providers, so by definition it goes through each and every portion of a data provider. You should be able to get some pretty good ideas from it.
Thanks Dwayne, I found what I was looking for in the code you referred me to.
For k = 1 To QueryFrom.Results.Count
Set ResultFrom = QueryFrom.Results(k)
Set ResultTo = QueryTo.Results.Add(ResultFrom.Class, ResultFrom.Object)
Next k
Now I can “loop through the result objects and/or condition objects to search for the specific class name & object name”.
[quote:e53b265c9b=“Barry D. Beaton”]Now I can “loop through the result objects and/or condition objects to search for the specific class name & object name”.
Thanks for the push.
[/quote]
It was probably a bit like a scavenger hunt, but I’m glad you found what you were looking for.
[quote:6451a97986=“Barry D. Beaton”]A “scavenger hunt” it was but once I found it, it really helped me to better understand the result and condition objects. Thanks
[/quote]
Exellent … the “teach a man to fish” principle alive and well.