Friday, February 24, 2012

Array of CatalogItem[] Objects Returned from ListChildren

In the RS help documentation, the ListChildren method notes, "If no children
exist, this method returns an empty CatalogItem object."
So, I'm wondering how can I detect if no items were returned from my
ListChildren call.
I though something like this:
Reports.ReportingServices.CatalogItem[] items = null;
items = rs.ListChildren("/MasterReports", true);
if (items != null)
{
// not empty
}
else
{
// no children, empty catalog
}
Will this work? Again the documentation says it'll return an "empty"
catalog object, not necessarily a "null" object.
Thanks.Actually, just use:
if (items.length > 0)
process items...
else
no children...
end if
=-Chris
"dvorak" <dvorak@.nospam.com> wrote in message
news:%23zbBBIgGFHA.3472@.TK2MSFTNGP09.phx.gbl...
> In the RS help documentation, the ListChildren method notes, "If no
> children
> exist, this method returns an empty CatalogItem object."
> So, I'm wondering how can I detect if no items were returned from my
> ListChildren call.
> I though something like this:
>
> Reports.ReportingServices.CatalogItem[] items = null;
> items = rs.ListChildren("/MasterReports", true);
> if (items != null)
> {
> // not empty
> }
> else
> {
> // no children, empty catalog
> }
>
> Will this work? Again the documentation says it'll return an "empty"
> catalog object, not necessarily a "null" object.
> Thanks.
>

No comments:

Post a Comment