SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Login page to show personalized reports

    Hi Folks,

    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?

    Many thanks

  2. #2
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    What have you tried so far? Have you tried conditional statments using User.Identity.Name?

  3. #3
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply.

    I struggled to understand how the reports are genearted from this page woich authenticates:

    http://xxx.xx.xx/Reports/Pages/Folder.aspx

    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
    end if

    Can you pass parameters like that to reports?

    Many thanks

  4. #4
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    string username = User.Identity.Name;
    
    if (username=="fred")
    {
    //DO YOUR REPORT HERE
    }

  5. #5
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Nightstalker,

    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?

    Thanks again

  6. #6
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    Hi

    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

  7. #7
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Nightstalker,

    Thans for your reply

    Can you tell me the code to generate each report? Are the reports generated with the page?

    Thanks again


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •