Hey guys, I finally got my report working and connections working to my webhost. Only problem is when I navigate to my reportserver, it prompts me for a username and password that corresponds to the system login. After that I have people enter their credentials that are cross referenced with the db. However, I don't want to give out the system password, otherwise other people who know the report manager url can get in and mess around. How do I avoid having the report server prompt me for the system user/pass?
Thanks.
Set an ASP.NET web site with the ReportViewer control on one of the pages. Grant run report to the ASP.NET user and then any user who can run the web site, can run a given report.|||If you are using the report viewer, you can impersonate a user. You need to set it in the web.config of the application. It falls under the System.Web section of the web.config and looks something like this:
<identity impersonate="true" userName="UserName" password="PassWord"/>
This way when someone accesses the web application they are impersonating the user and they are not promted. What I would do if possible is setup a seperate user then admin of course that has access to the report server though for security reasons. That user should just need to be able to access the report server, and any other credentials he may need to run your application. Just my thoughts...
Dapanther99
|||Thing is I cannot add that to the web.config where the reportserver resides. Otherwise, If I add that to the web.config where my asp files are located wouldn't that interfere with my existing scripts such as login pages?
Also, when you guys say report viewer, are you referring to the reportserver that allows me to view my reports but not manage them? Or is reportviewer as seperate item?
|||The report viewer is a control in ASP.NET 2.0. I resides under the data controls. In respect to the impersonated user, we have applications here that use impersonation without any issues. What you need to do is put it in the web.config of you application, not with the report server. If you have access to create additional users then you would create a user that has access to the report server. You will also need to impersonate this same user in the dataset the report uses. As well as make sure that he has DB access. The good thing about doing it this way is you create a trail in case you are using audit tables in your DB...
Dapanther99
|||ah ok, so by your definition, I am not using the report viewer, I'm using the direct url to the report server given to me by my hosting company,
(e.g.http://sqlserver/reportserver)
So I need to create an asp.net page that utilizes report viewer to access the reports from the report server. Am I correct up to this point?
Also, I did a search on my hosting company's KB, and they suggest using the following script:
<%
dim objHTTP
set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
url = "http://sqlreport01.mysite4now.com/ReportServer/Pages/ReportViewer.aspx?%2mysite%2fmyreport&rs:Command=Render"
objHTTP.open "get", url, false, "username", "password"
objHTTP.send
response.write objHTTP.responsetext
%>
Is this something I can skip? and just proceed to look up articles regarding the report viewer? (I've tried using that script in an asp page and I got nothing, thats why im asking)
Thanks
|||If you are writing it in .NET 2.0 I would go with the report viewer. You might want to check with the hosting company to make sure that it is installed on the servers because if I remember correctly we had to manually install it on our servers when we deployed our first reports using it...
Dapanther99
|||Great, I got the report viewer to work, now to get passed the iis authentication. I tried impersonate, but it's not working. When I do just <identity impersonate="true" /> the script runs, but the moment I add username and password, i get a run time error. Also, the script that I wrote above, from what i'm getting at is, that script opens up that page and inputs the username and password but doesn't display the page so in a sense you're opening a session. Am I correct?
I'd like to implement that if I can't get this impersonate thing to work but when I add that to my asp.net page, i also get a run time error.
any ideas guys?
|||Does the error display or do you have access to the error logs? Let me know what you are getting and I'll try to figure it out. It sounds like you may have the impersonate tag in the wrong place. Also, make sure you have the authentication mode set to forms. Let me know...
Dapanther99
|||Ok I added the line that gives me the actual error. It's saying that my username or password is incorrect. Now I'd like to get the concept straight.
I have a sql report server.
I have an asp page with the report viewer on another server. In that same folder I have a web.config file that has
<configuration>
<system.web>
<customErrors mode="Off"/>
<authentication mode="forms" />
<identity impersonate="true" userName="myuser" password="mypw" />
</system.web>
</configuration
1) Isn't it suppose to be windows auth? since the popup is IIS auth. (not that changing it to windows worked)
2) I'm getting the impression that it's looking for a local username on that server and not forwarding the request over to the report server.
3) This folder in which I have my asp.net page does not have user authentication.
4) This server and the report server both have the same user name and pw.
any ideas?
No comments:
Post a Comment