all groups > sql server reporting services > december 2004 >
You're in the

sql server reporting services

group:

Fetch the Report - Server Directory (and Items) - Structure programmaticaly in C-Sharp


RE: Fetch the Report - Server Directory (and Items) - Structure progra Herman K
12/28/2004 8:29:02 AM
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]
Fetch the Report - Server Directory (and Items) - Structure programmaticaly in C-Sharp Ralph Hüttenmoser
12/28/2004 1:49:04 PM
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




Re: Fetch the Report - Server Directory (and Items) - Structure progra Ralph Hüttenmoser
12/29/2004 9:59:03 AM
Thank you Herman

Re: Fetch the Report - Server Directory (and Items) - Structure progra Ralph Hüttenmoser
12/29/2004 11:32:47 AM
Hey Herman

what do you mean about "ETReportItems"

thanks Ralph


Re: Fetch the Report - Server Directory (and Items) - Structure pr Herman K
1/3/2005 10:59:06 AM
ETReports is just my type (a collection) of report items as opposed to
Microsoft's (which is an array) CatalogItem[].

[quoted text, click to view]
Re: Fetch the Report - Server Directory (and Items) - Structure pr Ralph Hüttenmoser
1/6/2005 8:46:54 PM
thanks Herman

AddThis Social Bookmark Button