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?
What have you tried so far? Have you tried conditional statments using User.Identity.Name?
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?
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
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?
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
Thans for your reply
Can you tell me the code to generate each report? Are the reports generated with the page?