通过 .net 应用程序将报告文件上传到报告管理器?

发布于 2024-09-14 23:12:59 字数 353 浏览 9 评论 0原文

我想通过 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 wayso how resolve that exception or If i not so guide me to right way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆沫 2024-09-21 23:12:59

您可能必须使用 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

您的代码将类似于

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

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文