sql server reporting services:
Here is some code I use to return a 'List' I myself will be adding the
hierarchy soon. Perhaps this will help:
public ETReportItems GetReports()
{
//Not really of much use in our initial release, this method is intended
to provide a 'list' of all reports
//available to a consumer. At this point, it just returns a list of all
reports on the server. We need to
//decide on a folder hierarchy that will be constrasted again the
ETPrincipal object, which will return only
//those reports visible to a given consumer.
CatalogItem[] reportServerItems = null;
ETReportItems reportItems = new ETReportItems();
SearchCondition any = new SearchCondition();
any.ConditionSpecified = false; //Causes a search for all items
any.Name = "Name"; //We could search by a number of items, any one is fine
SearchCondition[] allItems = new SearchCondition[1];
allItems[0] = any;
try
{
reportServerItems = reportingService.FindItems(ReportServicesRoot,
BooleanOperatorEnum.Or, allItems);
}
catch (SoapException e)
{
//TODO: How are we supposed to report exceptions?
throw e;
}
//Now we will determine which of these are reports
if (reportServerItems != null)
{
//We have at least one report server item
ETReportItem reportItem = null;
foreach (CatalogItem catalogItem in reportServerItems)
{
if (catalogItem.Type == ItemTypeEnum.Report && !catalogItem.Hidden)
{
//This item happens to be a report
//TODO: we still need to implement authorization, filtering of
subreports (if we can't insure they will never be used)
//and add additional properties we want to return
reportItem = new ETReportItem();
reportItem.description = catalogItem.Description;
reportItem.id = catalogItem.ID;
reportItem.name = catalogItem.Name;
reportItem.path = catalogItem.Path;
reportItems.AddItem(reportItem);
}
}
}
return reportItems;
}
[quoted text, click to view] "Ralph Hüttenmoser" wrote:
> Good afternoon
>
> Is it possible to fetch the Report - Server Directory (and Items) -
> Structure programmaticaly in C-Sharp for the specific user? (to represent in
> a Menuetree)
>
> Can someone point me a possible way?
>
> thanks in advance
>
> wishes Ralph
>
>
>
>
>