我正在尝试使用如下 URL 访问 SSRS 报告
http://MyServerIP/ReportServer?/FolderName/ReportName&Param1=ParamValue&rs:Command=Render&rs:Format=HTML4.0&rc:Toolbar=false
当我尝试访问 Url 上方时,系统会要求我提供网络凭据,然后我会在浏览器窗口中呈现所有 SSRS 报告页面。
现在我想在我的 webApp 内的弹出窗口中显示这些内容。为此,我尝试发出 jquery 请求并获取内容,但这样做我得到 401 未经授权的错误。所以我想知道是否有办法在 jquery ajax get 请求中发送凭据。
作为一个转机,我尝试使用下面的 C# 代码来检索数据,但它也没有帮助,并且给出了相同的 401 错误
WebClient client = new WebClient();
client.Credentials = new NetworkCredential("username", "password", "domain");
divContents.InnerText = client.DownloadString(my report path);
我正在使用 SSRS 2008 R2,我的要求是在弹出窗口中显示报告的所有页面。因此,欢迎所有指向这个方向的指针。
最后添加一点,我的 Web 应用程序和报告可能驻留在同一个域中,也可能不驻留在同一个域中。
谢谢,
拉维
最佳答案
我会尝试什么:
ReportExecution2005
Web 服务将您的报告呈现为 HTML。然后将结果泵出到窗口。 如果您需要,我可以提供一些示例代码。
ETA:我发现了一条可能有值(value)的信息:
这是来自 HTML Device Settings page (强调我的):
Toolbar
Indicates whether to show or hide the toolbar. The default of this parameter is true. If the value of this parameter is false, all remaining options (except the document map) are ignored. If you omit this parameter, the toolbar is automatically displayed for rendering formats that support it.
The Report Viewer toolbar is rendered when you use URL access to render a report. The toolbar is not rendered through the SOAP API. However, the Toolbar device information setting affects the way that the report is displayed when using the SOAP Render method. If the value of this parameter is true when using SOAP to render to HTML, only the first section of the report is rendered. If the value is false, the entire HTML report is rendered as a single HTML page.
关于asp.net - 通过 URL 访问 SSRS 报告时如何传递凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15816251/