通过 .net 应用程序将报告文件上传到报告管理器?
我想通过 C# 应用程序将报告文件上传到报告管理器。(意思是像简单上传一样,选择一个报告文件,然后将所选文件上传到报告管理器)。
我使用此示例,当我上传文件时发生异常远程服务器返回错误:(401)未经授权
** 我的代码 **
WebClient webclient = new WebClient();
webclient.UploadFile("http://server-report/Reports/Pages/", Source);
->源指所选文件路径。
那么如果走正确的路
那么如何解决该异常,或者如果我不这样引导我走正确的路?
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 way
so how resolve that exception or If i not so guide me to right way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能必须使用 Reporting Services Web 服务来执行此类操作。
查看 – 使用
访问 Reporting Services Web 服务http://msdn.microsoft.com/en-us/library/aa237438%28SQL.80%29.aspx
编辑
添加对 SSRS Web 服务的 Web 引用
例如
http://yourserver/reportservice/ReportService2005.asmx
您的代码将类似于
Edit 2
要通过 Visual Studio 添加 Web 引用
1) 右键单击您的项目
2) 选择“添加 Web 引用”选项
3) 输入 SSRS 2008 的 Web 服务 URL
该 Web 服务 URL 与上面提到的相同
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
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