Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello ,

I have angular2 project need to view some SSRS Reports , I used iframe to view report like that
<iframe [src]= "reportUri" style="width:100%;height:600px" id ="pdfDocument"></iframe>

ngOnInit() {
     this.reportUri = this.sanitizer.bypassSecurityTrustResourceUrl
         (
         // tslint:disable-next-line:max-line-length
         'http://000000.231:8081/ReportServer_MSSQL/Pages/ReportViewer.aspx?%2fHealthCare.Reports%2fPatientBalances&rs:Command=Render');

 }


my problem when i opened my report page shown prompt box to enter server username and password like image

report — imgbb.com[^]

What I have tried:

i need to pass server credential to SSRS from URL
Posted
Updated 24-Feb-22 23:49pm
v3
Comments
Richard Deeming 6-Nov-17 15:45pm    
You need to grant anonymous users "browser" access to your SSRS installation. Google has some suggestions as to how to do that.

You really don't want to put the credentials in the URL; anyone who has access to your page would be able to see them!
Golden Mind 6-Nov-17 16:04pm    
1- if i need pass credentials in the URL how can i do that
2- if i need to grant anonymous users "browser" access to your SSRS installation can you tell me steps or send url explain that because i made search but not found good result
Richard Deeming 6-Nov-17 16:14pm    
1) You can't. You used to be able to embed credentials in the URL, but they stopped that back in 2011:
Internet Explorer does not support user names and passwords in Web site addresses (HTTP or HTTPS URLs)[^]

2) If your users are part of your domain, you could try getting them to add the SSRS server to their "local intranet" zone in IE, which should then sign them in automatically using their Windows credentials. Otherwise, this MSDN blog post[^] seems to have the answer.

After days of research on microsoft msdn which is an amalgam of bad information without clear examples I figure out this solution. To view a report in iframe you must first make a small asp.net webforms project with a page with reportviewer control inside:

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>


<asp:scriptmanager runat="server">
<rsweb:reportviewer id="ReportViewer1" runat="server">



ReportViewer1.ProcessingMode = ProcessingMode.Remote;
CustomReportCredentials irsc = new CustomReportCredentials(UserName,Password, Domain); // if you dont have a domain enter computer name
ReportViewer1.ServerReport.ReportServerCredentials = irsc;
ReportViewer1.ServerReport.ReportServerUrl = host/reportServer not portal;
ReportViewer1.ServerReport.ReportPath = important! report path with folder that contains report.rdl

After that put in iframe src url to webform project ex: localhost/ReportPage.aspx You could find an example of class CustomReportCredentials :IReportServerCredentials if you search on google
 
Share this answer
 
v2
Hi,
I am having the exact same problem. Did you resolve it?

Talal
 
Share this answer
 
Comments
Patrice T 28-Jun-18 15:54pm    
Open your own question and delete this
Member 11115266 25-Dec-18 22:04pm    
Did u got this problem resolved if so pls post the solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900