Hi everybody!
I copied this code from which. It's supposed to allow me to run the CR8 object in IE passing two string parameters.
The report is running fine in Crystal Report but on ASP I'm getting this error "An exected error occured" on this line
session("oRpt"
.ReadRecords
Here is my code:
<%
reportname = "PO.rpt"
If Not IsObject (session("oApp"
) Then
Set session("oApp"
= Server.CreateObject("CrystalRuntime.Application"
End If
Path = "C:\Inetpub\
If IsObject(session("oRpt"
) then
Set session("oRpt"
= nothing
End if
Set session("oRpt"
= session("oApp"
.OpenReport(path & reportname, 1)
session("oRpt"
.MorePrintEngineErrorMessages = False
session("oRpt"
.EnableParameterPrompting = False
session("oRpt"
.DiscardSavedData
set session("ParamCollection"
= Session("oRpt"
.Parameterfields
set Param1 = session("ParamCollection"
.Item(1)
Param1.EnableMultipleValues = 1
ParamValue = "100000"
Call Param1.AddCurrentValue (CStr(ParamValue))
set Param2 = session("ParamCollection"
.Item(2)
Param2.EnableMultipleValues = 1
ParamValue1 = "CHI112"
Call Param2.AddCurrentValue (CStr(ParamValue1))
On Error Resume Next
session("oRpt"
.ReadRecords 'line with error
If Err.Number <> 0 Then
Response.write err.description
Response.Write "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine"
) Then
set session("oPageEngine"
= nothing
End If
set session("oPageEngine"
= session("oRpt"
.PageEngine
End If
%>
<!-- #include file="SmartViewerActiveX.asp" -->
Can anybody help me to solve this problem. Its' getting nowhere!
Thank you a lot!
Durug
I copied this code from which. It's supposed to allow me to run the CR8 object in IE passing two string parameters.
The report is running fine in Crystal Report but on ASP I'm getting this error "An exected error occured" on this line
session("oRpt"
Here is my code:
<%
reportname = "PO.rpt"
If Not IsObject (session("oApp"
Set session("oApp"
End If
Path = "C:\Inetpub\
If IsObject(session("oRpt"
Set session("oRpt"
End if
Set session("oRpt"
session("oRpt"
session("oRpt"
session("oRpt"
set session("ParamCollection"
set Param1 = session("ParamCollection"
Param1.EnableMultipleValues = 1
ParamValue = "100000"
Call Param1.AddCurrentValue (CStr(ParamValue))
set Param2 = session("ParamCollection"
Param2.EnableMultipleValues = 1
ParamValue1 = "CHI112"
Call Param2.AddCurrentValue (CStr(ParamValue1))
On Error Resume Next
session("oRpt"
If Err.Number <> 0 Then
Response.write err.description
Response.Write "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine"
set session("oPageEngine"
End If
set session("oPageEngine"
End If
%>
<!-- #include file="SmartViewerActiveX.asp" -->
Can anybody help me to solve this problem. Its' getting nowhere!
Thank you a lot!
Durug