Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using TeamCity to deploy SSRS 2008 R2 Reporting Projects

We are looking to integrate our SSRS 2008 R2 projects into our automated build process. Currently three times a week TeamCity builds and deploys our C# codebase. We'd like to add the SSRS report projects to that. The RDL files are currently in a Subversion source control repository.

like image 569
msigman Avatar asked Mar 22 '12 02:03

msigman


1 Answers

You can use Report Server Web Service for this purpose. It has CreateItem method that uploads report to Reporting Service.

To created C# project that uploads rdl files you will need to create proxy class for your ReportService2010.asmx endpoint and then use is it like this:

ReportingService2010 reportingService = new ReportingService2010();
reportingService.Url = url + "/ReportService2010.asmx";
reportingService.Credentials = new System.Net.NetworkCredential(username, password, domain);
Microsoft.SqlServer.ReportingServices2010.Warning[] warnings = null;            

using (FileStream reportStream = new FileStream("c:\\report.rdl", 
       FileMode.Open, FileAccess.Read))
{
    using (MemoryStream ms = new MemoryStream())
    {
        reportStream.CopyTo(ms);
        CatalogItem report = reportingService.CreateCatalogItem(
            "Report",
            "Report1",
            "/",
            true,
            ms.ToArray(),
            null,
            out warnings);
     }
}
like image 87
Denis Palnitsky Avatar answered Sep 23 '22 10:09

Denis Palnitsky