I am using the Crystal 8 ActiveX Viewer in an ASP page. I am setting both my Session(oApp) and Session(oRpt) objects successfully. I am loading a Crystal 8 designed report which contains no database connections (it only contains a label saying this is a test report)
However as soon as we reach the line that says CRViewer.ViewReport I get a "User Session has expired" message followed by the viewer in the browser showing no report. I did try to set the timeout property for the session objects but it did not help or resolve the problem.
Server side script:
===================
If Session("oApp"
Is Nothing Then
Session("oApp"
= Server.CreateObject("CrystalRuntime.Application"
End If
If Not Session("oRpt"
Is Nothing Then
Session("oRpt"
= Nothing
End If
Path = Request.ServerVariables("PATH_TRANSLATED"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
End While
Session("oRpt"
= Session("oApp"
.OpenReport(Path & reportname, 1)
Session("oRpt"
.MorePrintEngineErrorMessages = False
Session("oRpt"
.EnableParameterPrompting = False
Client side script:
===================
Dim webBroker
Dim webSource
Set webBroker = CreateObject("WebReportBroker.WebReportBroker"
Set webSource = CreateObject("WebReportSource.WebReportSource"
webSource.ReportSource = webBroker
webSource.URL = "rptserver.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportName = "TestReport"
CRViewer.ReportSource = webSource
CRViewer.ViewReport 'This line generates the error.....
However as soon as we reach the line that says CRViewer.ViewReport I get a "User Session has expired" message followed by the viewer in the browser showing no report. I did try to set the timeout property for the session objects but it did not help or resolve the problem.
Server side script:
===================
If Session("oApp"
Session("oApp"
End If
If Not Session("oRpt"
Session("oRpt"
End If
Path = Request.ServerVariables("PATH_TRANSLATED"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
End While
Session("oRpt"
Session("oRpt"
Session("oRpt"
Client side script:
===================
Dim webBroker
Dim webSource
Set webBroker = CreateObject("WebReportBroker.WebReportBroker"
Set webSource = CreateObject("WebReportSource.WebReportSource"
webSource.ReportSource = webBroker
webSource.URL = "rptserver.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportName = "TestReport"
CRViewer.ReportSource = webSource
CRViewer.ViewReport 'This line generates the error.....