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.
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);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With