I am having SSRS report server credentials. I want the users to auto login (impersonate) whenever they go to the reports page using the credentials that I have hard coded. I am using Angular ngx-ssrs-reportviewer plugin but every time i open the report the i have the following prompt can i pass a fixed credentials ?!
![enter image description here](https://i.stack.imgur.com/LXjn7.png)
这是因为 SSRS(报表服务器)使用 Windows 身份验证。就像 ngx-ssrs-reportviewer 文档中的“限制”部分所述,这不是您可以在 Angular UI 中修复的问题。
https://www.npmjs.com/package/ngx-ssrs-reportviewer https://www.npmjs.com/package/ngx-ssrs-reportviewer
StackOverflow 和其他网站上发布了许多解决方法;然而,我发现最简单的事情是使用 Microsoft 的 Report Viewer 控件创建一个普通的 .NET WebForms 站点。
https://learn.microsoft.com/en-us/sql/reporting-services/application-integration/integrating-reporting-services-using-reportviewer-controls-get-started?view=sql-server-ver15 https://learn.microsoft.com/en-us/sql/reporting-services/application-integration/integrating-reporting-services-using-reportviewer-controls-get-started?view=sql-server-ver15
然后,您只需像打开任何外部网站一样从 Angular 打开此网站/url,传递所有必需的报告输入、reportServer、reportPath 和安全令牌。在.NET 端,您必须验证令牌,然后使用硬编码/服务用户(您可以从 web.config 获取以使其可配置)。或者您可以以某种方式从令牌中获取用户,但这完全是另一个主题。
关于 .NET Webforms Report Viewer 有很多详细信息,我显然会跳过,但重点是在常规 .NET 页面上完成所有工作,然后从 Angular 开始很容易,因为您只需构建一个 url 并执行以下任一操作:
窗口.打开
or
窗口位置.href
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)