Creating an inbox

I have spent a fair bit of time on Reporting Services news groups lately. I have seen several people asking how to generate reports and go back and render them later. I'll do this via multiple blog entries mostly because I'm too tired to write the whole solution out now. :)

This is not a trivial problem, to figure out. Yet it's quit easy to do. So lets first define the requirements. I want to select a report and generate it, then be able to go off and do something else. Then come back to an inbox of reports later and render the report I generated earlier. The solution utilizes several areas of reporting services.

First you can use the ListChildren( ) method to get a list of reports available to be rendered. Tip: ListChildren returns all items so you should loop through and check which one's are reports so you don't end up displaying a list of DataSources and Folders.

MyLocalReportService.ReportingService rep = new MyLocalReportService.ReportingService();
   rep.Credentials = System.Net.CredentialCache.DefaultCredentials;
   MyLocalReportService.CatalogItem[] cat;

   cat = rep.ListChildren("/",true);

   foreach (MyLocalReportService.CatalogItem item in cat)
   {
    if (item.Type == MyLocalReportService.ItemTypeEnum.Report)
    {
     this.ReportslistBox.Items.Add(item.Name);
    }
   }

Next time I'll show you how to create a linked report that can be used to generate snapshot history items.