Sessions and Crystal Reports

F

furby

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?
 
T

Turkbear

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..
 
F

furby

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

Turkbear

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

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?
 
F

furby

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....
 
T

Turkbear

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top