我们希望将我们的SSRS 2008 R2项目整合到我们的自动构建流程中。 目前TeamCity每周三次构建并部署我们的C#代码库。 我们希望将SSRS报告项目添加到该项目中。 RDL文件当前位于Subversion源代码控制库中。
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.
最满意答案
您可以将Report Server Web服务用于此目的。 它具有CreateItem方法,可将报告上载到 Reporting Service。
要创建上传rdl文件的C#项目,您需要为您的ReportService2010.asmx端点创建代理类 ,然后使用它是这样的:
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); } }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); } }
更多推荐
发布评论