Angular ngx-ssrs-reportviewer Credential Problems

隐身守侯 提交于 2020-12-15 06:37:54

问题


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 ?!


回答1:


This is because of Windows Authentication used by SSRS (Report Server). Like it says in the Limitations section in the documentation of ngx-ssrs-reportviewer this is not something you can fix in angular UI.

https://www.npmjs.com/package/ngx-ssrs-reportviewer

There are many workarounds posted in StackOverflow and other websites; however, the easiest thing I found is to create a plain .NET WebForms site using the Report Viewer control from Microsoft.

https://docs.microsoft.com/en-us/sql/reporting-services/application-integration/integrating-reporting-services-using-reportviewer-controls-get-started?view=sql-server-ver15

Then you simply open this website/url from angular like you do any external website, passing all required report inputs, reportServer, reportPath, and the security token. On the.NET side you have to validate the token and then use a hardcoded/service user (you can get from web.config to make it configurable). Or you can somehow get the user from the token but that is a whole other topic.

There are a lot of details on the .NET webforms Report Viewer I am obviously skipping, but the point is do all the work on regular .NET page and then from angular is easy because you just build a url and do either:

window.open

or

window.location.href



来源:https://stackoverflow.com/questions/60189729/angular-ngx-ssrs-reportviewer-credential-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!