mattastic — 2011-03-22T11:15:34-04:00 — #1
I have reporting setup on my webserver using sql server 2005 and asp.net 2.0
I would like to show different reports depending on who logs in.
Could anyone point me in the right direction?
nightstalker — 2011-03-22T12:26:31-04:00 — #2
What have you tried so far? Have you tried conditional statments using User.Identity.Name?
mattastic — 2011-03-22T15:17:54-04:00 — #3
Thanks for your reply.
I struggled to understand how the reports are genearted from this page woich authenticates:
I was thinking about doing something very basic like:
if username = fred then
send user to http://xxx.xx.xx/Reports/Pages/Folder.aspx?folder=fred
Can you pass parameters like that to reports?
nightstalker — 2011-03-23T00:54:18-04:00 — #4
Well, I do not know how your reports are setup, but yes, you can send parameters on urls like that. But you do not really need to.
You could just have something like this on the page:
string username = User.Identity.Name;
//DO YOUR REPORT HERE
mattastic — 2011-05-11T10:29:05-04:00 — #5
Thanks for your rpeplies, and sorry its taken so long to get back to you.
I dont have windows authentication on my setup, the usernames are stored in a db which i manage and I can query easily enough.
So I can now create a login page, but how do i store the variable and pass it to the report?
Can this be done in my aspx page or in sql server?
nightstalker — 2011-05-12T00:22:41-04:00 — #6
The method I mentioned above is for Forms Authentication. eg. Storing passwords in the database.
When you log the user in, with forms authentication, you will be able to get their username with the method I suggested above
mattastic — 2011-06-08T06:35:08-04:00 — #7
Thans for your reply
Can you tell me the code to generate each report? Are the reports generated with the page?