Click here to Skip to main content
15,607,524 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

i have an windows2008r2 server with sqlserver2008re and reporting services.
On the other site is my wpf-applictation on a client where i want to show my reports in a webbrowser-control.
Everything works fine. But ther is still the problem, that i have to login when i call the report through the url "http://myserver/reportserver/myreport"

Is there a way to use networkcredentials together with the webbrowser control for autologin? I don't want that the user notifies that there is a login anyway so it must be done in background.

Thanks for your fast replies

Updated 30-Jun-11 2:22am

I already did tried to use HttpWebRequest like this.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"http://myserver/reportserver/myreport");
request.Credentials = new NetworkCredential("user", "password");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

But Didn't work becaus ther are tons of script-errors
Share this answer
Now i changed the authorization from the Reportserver from Ntlm to Basic...there i can insert my logininformation by aditional headers in den webbrowser.Navigate-method.
But the login-popup still occurs...

byte[] authData = System.Text.UnicodeEncoding.UTF8.GetBytes("user: password");
string authHeader = "Authorization: Basic " + Convert.ToBase64String(authData) + "\r\n";
browser.Navigate(uri, "", null, authHeader);

Any other idears?
Share this answer
Jesse Chisholm 6-May-13 10:36am    
This has worked for me ... except ... that the URI was to a page that auto-loaded a javascript URI and a CSS URI and an iframe HTML URI. WireShark shows that the original request has the correct credentials, but that one or more subordinate requests do not have the provided credentials. Still hunting a solution.
Member 10186849 3-Aug-13 6:08am    
Have you got solution for this problem..
You can use a HttpWebRequest object to post the credentials behind the scenes. Google is your friend.
Share this answer
Doriath21 4-Jul-11 5:11am    
Could you please be more precisely?

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