Upload a report file to Report manager via .net application?

人走茶凉 提交于 2019-12-23 02:25:09

问题


I want to upload report files via c# application to the report manager.(mean Like simple Upload, select a report file and then upload selected file into report manager).
I use this sample and when i upload file an exception occurred the remote server returned an error: (401) unauthorized
** my code **

WebClient webclient = new WebClient();
webclient.UploadFile("http://server-report/Reports/Pages/", Source);

-> source refer to selected file path.
so if walking in right wayso how resolve that exception or If i not so guide me to right way?


回答1:


you might have to use the Reporting Services Web Service to perform such operations.

have a look at – Accessing the Reporting Services Web Service Using

http://msdn.microsoft.com/en-us/library/aa237438%28SQL.80%29.aspx

Edit Add a web reference to SSRS web services e.g. http://yourserver/reportservice/ReportService2005.asmx

your code will be something like

ReportingService2005.ReportingService2005 service = new ReportingService2005.ReportingService2005();

    service.CreateReport("your report","parent folder",true,<rdl byte array>,<rdl properties byte array>)

Edit 2 To add web reference through Visual Studio

1) Right click on your project

2) select "add web reference" option

3) enter the webservice url

for SSRS 2008 the webservice url is the same as mentioned above



来源:https://stackoverflow.com/questions/3490875/upload-a-report-file-to-report-manager-via-net-application

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