Sessions and Crystal Reports

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • furby

    Sessions and Crystal Reports

    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?

  • Turkbear

    #2
    Re: Sessions and Crystal Reports

    On 29 Jun 2006 09:41:16 -0700, "furby" <WookieTim@gmai l.com> wrote:
    [color=blue]
    >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?[/color]


    How are you calling the Report?...Perha ps a new session is created..

    Comment

    • furby

      #3
      Re: Sessions and Crystal Reports

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

      Turkbear wrote:[color=blue]
      > On 29 Jun 2006 09:41:16 -0700, "furby" <WookieTim@gmai l.com> wrote:
      >[color=green]
      > >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?[/color]
      >
      >
      > How are you calling the Report?...Perha ps a new session is created..[/color]

      Comment

      • Turkbear

        #4
        Re: Sessions and Crystal Reports

        On 29 Jun 2006 10:37:13 -0700, "furby" <WookieTim@gmai l.com> wrote:
        [color=blue]
        >The ASP code does a redirect to a address that is that particular
        >report. Something like 'Response.redir ect "Report.rpt "'.
        >
        >Turkbear wrote:[color=green]
        >> On 29 Jun 2006 09:41:16 -0700, "furby" <WookieTim@gmai l.com> wrote:
        >>[color=darkred]
        >> >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?[/color]
        >>
        >>
        >> How are you calling the Report?...Perha ps a new session is created..[/color][/color]

        Probably more like
        Response.Redire ct{"/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?


        Comment

        • furby

          #5
          Re: Sessions and Crystal Reports

          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_criteri a.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....

          Comment

          • Turkbear

            #6
            Re: Sessions and Crystal Reports

            On 29 Jun 2006 13:12:48 -0700, "furby" <WookieTim@gmai l.com> wrote:

            [color=blue]
            >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....[/color]

            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...wit hout 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..Some one may have had the exact problem..



            Comment

            Working...