【问题标题】:Get SSRS report as pure html for c# code将 SSRS 报告作为纯 html 获取 c# 代码
【发布时间】:2014-02-24 15:59:53
【问题描述】:

我正在尝试将 SSRS repoert 作为 html 以在移动设备上打开它。 如果我使用以下模式 URL,我已将相关凭据添加到 HttpWebRequest 对象并成功获得结果:

http://APPserver.com/ReportServer/Pages/ReportViewer.aspx?/APP/APP%20Reports/RequestReport&ReportFormat=expandable&rc:Parameters=false&APPRequestId=c624561c-5f40-4545-8e13-d900c83449a8&rs:Command=Render&rs:Format=HTML4.0


这种格式给了我很多文本,但不是我需要的纯 html,所以我添加了清理报告文件的参数,这正是我所需要的来自浏览器,但是当我'我试图从 c# 代码中获取它,但出现 401 错误。

参数为:

&rc:toolbar=false

如下:

http://APPserver.com/ReportServer/Pages/ReportViewer.aspx?/APP/APP%20Reports/RequestReport&ReportFormat=expandable&rc:Parameters=false&APPRequestId=c624561c-5f40-4545-8e13-d900c83449a8&rs:Command=Render&rs:Format=HTML4.0&rc:toolbar=false

我使用管理员凭据从 hte 服务器自己检查此代码,但使用此参数的代码没有任何作用。

谢谢! 纳夫塔利。

【问题讨论】:

    标签: c# asp.net reporting-services httpwebrequest


    【解决方案1】:

    我找到了解决浏览器和代码凭据之间差异的方法。 使用默认网络凭据给了我与浏览器客户端相同的凭据:

    request.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
    

    代替:

    request.Credentials = request.Credentials = new NetworkCredential("user", "password");
    

    显然使用凭证结构提供了更多需要的数据。

    谢谢, 纳夫塔利。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多