Removing reports / report folder by SSRS (SQL SERVER REPORTING SERVICE)
2013-02-17 09:48
411 查看
Goal :
Remove the report folder from backstage.
Implement Steps:
1. Create a C# console application project.
2. Add one web reference into the project.
3. Open the “Web References/WebServicelocalhost” folder from the project location directory and find out the “Reference.cs” file in there.
4. Create a new console project then add the “References. cs” as a class file, add the web reference project as a reference.
5. Open the web reference project and change the internal keyword to public in the file of “Settings.Designer.cs”.
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
6. Open the “Reference.cs” file and change the namespace to a new definitely one.
//WebServicelocalhost
namespace TempWebRef.LocalReportServiceRemoveGenReport { ...
7. Create a static private method in the “Reference.cs “ class ,it is will be better write around the “DeleteItem” default method.
代码
8. public void DeleteItem(string Item) {
9. this.Invoke("DeleteItem", new object[] {
10. Item});
11. }
12.
13. public static string DeleteReport(string _reportPath, string _reportServerURL)
14. {
15. string strReturn;
16. strReturn = "success";
17. try
18. {
19. ReportingService2005 rs = new ReportingService2005(); // Declare one reference object .
20. _reportPath = "/GenevaReports/13Report"; // Naming the report path you want to remove. And if you want to remove a folder , only change the path as the main folder name like ‘/GenevaReports’
21. _reportServerURL = "http://" + _reportServerURL + "/reportserver/ReportService2005.asmx"; // Create the report server URL string which the reports belong to.
22.
23. rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
24. rs.Url = _reportServerURL;
25.
26.
27. rs.DeleteItem(_reportPath); // Call the execution.
28.
29. return strReturn;
30. }
31. catch (Exception xe)
32. {
33.
34. strReturn = xe.Message + _reportServerURL;
35. return strReturn;
36. }
37.
8. Switch to another project and call the report deleting method like below.
string stemp = TempWebRef.LocalReportServiceRemoveGenReport.ReportingService2005.DeleteReport("TestReport","Server3");
Remove the report folder from backstage.
Implement Steps:
1. Create a C# console application project.
2. Add one web reference into the project.
3. Open the “Web References/WebServicelocalhost” folder from the project location directory and find out the “Reference.cs” file in there.
4. Create a new console project then add the “References. cs” as a class file, add the web reference project as a reference.
5. Open the web reference project and change the internal keyword to public in the file of “Settings.Designer.cs”.
public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
6. Open the “Reference.cs” file and change the namespace to a new definitely one.
//WebServicelocalhost
namespace TempWebRef.LocalReportServiceRemoveGenReport { ...
7. Create a static private method in the “Reference.cs “ class ,it is will be better write around the “DeleteItem” default method.
代码
8. public void DeleteItem(string Item) {
9. this.Invoke("DeleteItem", new object[] {
10. Item});
11. }
12.
13. public static string DeleteReport(string _reportPath, string _reportServerURL)
14. {
15. string strReturn;
16. strReturn = "success";
17. try
18. {
19. ReportingService2005 rs = new ReportingService2005(); // Declare one reference object .
20. _reportPath = "/GenevaReports/13Report"; // Naming the report path you want to remove. And if you want to remove a folder , only change the path as the main folder name like ‘/GenevaReports’
21. _reportServerURL = "http://" + _reportServerURL + "/reportserver/ReportService2005.asmx"; // Create the report server URL string which the reports belong to.
22.
23. rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
24. rs.Url = _reportServerURL;
25.
26.
27. rs.DeleteItem(_reportPath); // Call the execution.
28.
29. return strReturn;
30. }
31. catch (Exception xe)
32. {
33.
34. strReturn = xe.Message + _reportServerURL;
35. return strReturn;
36. }
37.
8. Switch to another project and call the report deleting method like below.
string stemp = TempWebRef.LocalReportServiceRemoveGenReport.ReportingService2005.DeleteReport("TestReport","Server3");
相关文章推荐
- Removing reports / report folder by SSRS (SQL SERVER REPORTING SERVICE)
- SQL Server BI Step by Step SSRS 1-Reporting Service 2008的新特性
- SQL Server BI Step by Step SSRS 1-Reporting Service 2008的新特性
- rs 实用工具 (rs.exe) (SSRS)SQL server report service
- Sql Server Report Service 的部署问题(Reporting Service 2014為什麼不需要IIS就可以運行)
- SSRS (SQL Server Report Service) 在IE9, IE10下显示不全的解决办法
- 在每页(分页)报表中重复显示标题 - SQL Server Reporting Service (SSRS)
- SQL server Reporting Service(SSRS)
- SQL Server Reporting Service - Deployment by command line
- SSRS (SQL Server Report Service) 在IE9, IE10下显示不全的解决办法
- SSRS (SQL Server Report Service) 在IE9, IE10下显示不全的解决办法
- Reporting Service for SQL server 2000预览研究
- SQL Server Reporting Services(简称SSRS)
- Reporting Service for SQL server 2000预览研究
- Reporting Service for SQL server 2000预览研究
- Reporting Service for SQL server 2000预览研究
- SQL Server Report Service rdl报表
- SQL Server Reporting Service 简介 (1~6PDF)
- SQL Server Reporting Services(简称SSRS)
- TIP: Configure SQL Server Reporting Service 2008