Delete Reports in an SQL Azure Sub-Folder

这一生的挚爱 提交于 2020-01-04 13:22:42

问题


The migration of the SQL Reporting component of Windows Azure from the old portal to the newer html 5 one has in the process limited the folder hierarchy to 2 levels deep (As indicated in this article).

The article does however state that existing reporting services can still have deeper hierarchies; whilst Business Intelligence Development Studio still allows you to deploy to the sub folder.

We have preserved our hierarchy like so:

  • Root Level
    • Client Reports
    • Internal Reports
      • Report Category 1
        • Data Source
        • Report1.rdl
        • Report2.rdl
      • Report Category 2

Due to the number of reports we have it is unfeasible to have every folder at root level and, thus far, the hierarchy has still be functioning correctly.

However we have run into a problem; we can no longer update any data sources or delete reports that are more than 2 levels deep.

Rather than restructure all our reports to suit what feels like an extremely restrictive structure, is there a way of managing our SQL Reporting reports external to the portal, via either an API, BIDS or Powershell?


回答1:


OK so I've done a bit of research into this; SQL Reporting on Windows Azure exposes the ReportService2010 SOAP interface for administering the reports programmatically.

Using a proxy generated through the WSDL tool we can remotely connect to SQL Reporting using the below C# code:

var reportServiceUrl = 
    "https://X.reporting.windows.net/reportserver/reportservice2010.asmx?wsdl";
var serviceUsername = "AdminUserName;
var servicePassword = "AdminPassword";

var reportingService = new ReportingService2010
    {
        Url = reportServiceUrl,
        CookieContainer = new CookieContainer()
    };

 reportingService.LogonUser(serviceUsername, servicePassword, reportServiceUrl);

The reportingService object can then be used to upload, update and delete all items on the SQL Reporting instance. If, for example, I wanted to delete a report in a sub folder that cannot be accessed on the Windows Azure portal, I could use:

reportingService.DeleteItem("Internal Reports/Report Category 1/Report1.rdl");

That stated; it is much easier to refactor the report folders to a 2 level hierarchy instead. The naming convention we ended up using is:

  • Root Level
    • Internal Reports - Report Category 1
      • Data Source
      • Report1.rdl
      • Report2.rdl
    • Internal Reports - Report Category 2


来源:https://stackoverflow.com/questions/17618886/delete-reports-in-an-sql-azure-sub-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!