Sessions and Crystal Reports

Discussion in 'ASP General' started by furby, Jun 29, 2006.

  1. furby

    furby Guest

    I'm asking this on the off chance that someone out there might have
    seenit before.

    In my current application, when the user logs in, the state variable
    called "role" is assigned to them, detailing what they can do and what
    they cannot do. This variable follows them through the entire
    application (It is assigned using Session("role") = "xxx").

    Problem is, when I run a crystal reports RPT file, I lose the session
    variable - it reverts to being equal to "", rather than "ADMIN" or some
    such thing. I can track this throughout the app and i know for a fact
    that it happens as soon as a RPT file is run... Has anyone else seen
    something like this before?
     
    furby, Jun 29, 2006
    #1
    1. Advertising

  2. furby

    Turkbear Guest

    On 29 Jun 2006 09:41:16 -0700, "furby" <> wrote:

    >I'm asking this on the off chance that someone out there might have
    >seenit before.
    >
    >In my current application, when the user logs in, the state variable
    >called "role" is assigned to them, detailing what they can do and what
    >they cannot do. This variable follows them through the entire
    >application (It is assigned using Session("role") = "xxx").
    >
    >Problem is, when I run a crystal reports RPT file, I lose the session
    >variable - it reverts to being equal to "", rather than "ADMIN" or some
    >such thing. I can track this throughout the app and i know for a fact
    >that it happens as soon as a RPT file is run... Has anyone else seen
    >something like this before?



    How are you calling the Report?...Perhaps a new session is created..
     
    Turkbear, Jun 29, 2006
    #2
    1. Advertising

  3. furby

    furby Guest

    The ASP code does a redirect to a address that is that particular
    report. Something like 'Response.redirect "Report.rpt"'.

    Turkbear wrote:
    > On 29 Jun 2006 09:41:16 -0700, "furby" <> wrote:
    >
    > >I'm asking this on the off chance that someone out there might have
    > >seenit before.
    > >
    > >In my current application, when the user logs in, the state variable
    > >called "role" is assigned to them, detailing what they can do and what
    > >they cannot do. This variable follows them through the entire
    > >application (It is assigned using Session("role") = "xxx").
    > >
    > >Problem is, when I run a crystal reports RPT file, I lose the session
    > >variable - it reverts to being equal to "", rather than "ADMIN" or some
    > >such thing. I can track this throughout the app and i know for a fact
    > >that it happens as soon as a RPT file is run... Has anyone else seen
    > >something like this before?

    >
    >
    > How are you calling the Report?...Perhaps a new session is created..
     
    furby, Jun 29, 2006
    #3
  4. furby

    Turkbear Guest

    On 29 Jun 2006 10:37:13 -0700, "furby" <> wrote:

    >The ASP code does a redirect to a address that is that particular
    >report. Something like 'Response.redirect "Report.rpt"'.
    >
    >Turkbear wrote:
    >> On 29 Jun 2006 09:41:16 -0700, "furby" <> wrote:
    >>
    >> >I'm asking this on the off chance that someone out there might have
    >> >seenit before.
    >> >
    >> >In my current application, when the user logs in, the state variable
    >> >called "role" is assigned to them, detailing what they can do and what
    >> >they cannot do. This variable follows them through the entire
    >> >application (It is assigned using Session("role") = "xxx").
    >> >
    >> >Problem is, when I run a crystal reports RPT file, I lose the session
    >> >variable - it reverts to being equal to "", rather than "ADMIN" or some
    >> >such thing. I can track this throughout the app and i know for a fact
    >> >that it happens as soon as a RPT file is run... Has anyone else seen
    >> >something like this before?

    >>
    >>
    >> How are you calling the Report?...Perhaps a new session is created..


    Probably more like
    Response.Redirect{"/virtual_dir/Report.rpt")

    I believe the redirect creates/starts a new session ( depending, maybe, on where the new location is in relation to the
    sending one) so you would need to pass the Session Variable needed in the redirect and read it there - assuming you need
    it there...

    How does the app 'get back' from the redirect?
     
    Turkbear, Jun 29, 2006
    #4
  5. furby

    furby Guest

    The way this app is set up (I don't particularly care for it, but I
    sort of inherited it) is this :

    The user comes to a page called "Report_criteria.asp", which is
    displayed in an Iframe. when the user clicks on a report, the results
    dislplay in a separate window (Through the use of a "target='_Blank'"
    in the form that submits it). The reason the page is using a redirect
    is because the user can select any of a number of reports.

    Problem is, I'm using a session variable in the app that is called
    "Role" to decide what combination of links to show accross the top of
    each page as each separate role has a certain subset of those links.

    I don't use the session variable in the report at all and the user
    never "Get's back" from the report - they simply close out the window
    it displays in.

    But, the fun thing is that I can track the session("Role") variable. It
    holds true until I run the rpt file, then it loses it - essentially
    leaving the user with nothing to do beyond the links that everybody
    gets - in other words, they go from being an admin user to being a
    nothing user, in one fell swoop. And this doesn't happen anywhere else
    in the app - only when the user invokes a crystal reports rpt file,
    does the session get lost.

    I'm starting to wonder if maybe there is some sort of bug in crystal
    reports that destroys session variables in ASP apps. I've tried
    tracking other session variables and they are also lost at the same
    time. I also tried naming the session variables something else (Tried
    "RoleVar", "VarRole", "Admin", "AdminRole", and so on) and they all get
    lost in the same way - every time I run a crystal reports report. Also,
    this happens when I run ANY Crystal RPT file - not just this one....

    It's just really really weird - I have never seen this happen before....
     
    furby, Jun 29, 2006
    #5
  6. furby

    Turkbear Guest

    On 29 Jun 2006 13:12:48 -0700, "furby" <> wrote:


    >I'm starting to wonder if maybe there is some sort of bug in crystal
    >reports that destroys session variables in ASP apps. I've tried
    >tracking other session variables and they are also lost at the same
    >time. I also tried naming the session variables something else (Tried
    >"RoleVar", "VarRole", "Admin", "AdminRole", and so on) and they all get
    >lost in the same way - every time I run a crystal reports report. Also,
    >this happens when I run ANY Crystal RPT file - not just this one....
    >
    >It's just really really weird - I have never seen this happen before....


    Well, that method of calling a Crystal report is not a supported one anymore but I doubt it is a bug..
    We use session variables in our asp pages that call Crystal ( the modern way, with COM objects in asp pages or having
    them published to Enterprise or Crystal Report Server) and they are persistant..

    The fact the ALL your session variables are lost indicates to me that the session that set them has been
    abandoned...without seeing the exact code used in calling the report, I do not know where/why that would be happening..

    Sorry I can;t be of more help..Try one of the great Crystal-Related forums in www.tek-tips.com - many experienced
    'real-world' users there provide very good solutions..Someone may have had the exact problem..
     
    Turkbear, Jun 29, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page