gexen
asked on
CR 8.5 - > CR10 Conversion
Hello,
I have never done anything in Crystal Reports before today, and probably never will again. We have a client who used Crystal Reports 8.5 to generate and distribute their reports over the web. Unfortunately, it does not appear that CR 8.5 Enterprise will work on a 2003 Server, so we are installing CrystalReports 10. We have already made a lot of progress with configuration, but now we are at the code section where I am admittely very weak having never worked with CR before. Here is the code snippet, and my questions can be found below:
Set objFactory = CreateObject("CrystalRepor ts.ObjectF actory")
Set Session("objFactory") = objFactory
Set rptAppSession = objFactory.CreateObject("C rystalRepo rts.Report AppSession ")
' The name of the ReportAppServer is specified in clientSDKOptions.xml
rptAppSession.Initialize
Set Session("rptAppSession") = rptAppSession
'If Not IsObject (session("oApp")) Then
'Set session("oApp") = Server.CreateObject("Cryst alReports. ReportAppS ession")
'End If
Path = Request.ServerVariables("P ATH_TRANSL ATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Set session("oRpt") = rptAppSession.CreateServic e("Crystal ClientDoc. ReportClie ntDocument ")
Session("oRpt").Open path & reportname
If Err.Number <> 0 Then
Response.Write "Error Occurred Creating Report Object: " & Err.Description & "<BR>" & CS_CLOSEMSG
'response.Write("<Br>" & path & reportname)
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
End If
if err.number = 0 and not bolHideLogo then
on error resume next
session("oRpt").Sections.i tem(CINT(i ntGP)).Add PictureObj ect path & "logos\" & strLogoName, 720, 10
if err.number <> 0 then err.Clear()
on error goto 0
end if
'session("oRpt").MorePrint EngineErro rMessages = False
'session("oRpt").EnablePar ameterProm pting = False
'session("oRpt").DiscardSa vedData
oADOConnection.Open(CS_PRO VIDER)
'response.Write request.QueryString("filte r") & strORDER
'response.end
Set oADORecordset = oADOConnection.Execute(req uest.Query String("fi lter") & strORDER)
Set oRptTable = session("oRpt").Database.T ables.Item (1)
oRptTable.SetPrivateData 3, oADORecordset
Question 1: Right now, I am getting an error message:
Microsoft VBScript runtime error '800a0009'
Subscript out of range
/sw_reporting.asp, line 150
When I attempt to run the code. Line 150 is: oRptTable.SetPrivateData 3, oADORecordset
Question 2: Is there a CR10 equivalent for:
'session("oRpt").MorePrint EngineErro rMessages = False
'session("oRpt").EnablePar ameterProm pting = False
'session("oRpt").DiscardSa vedData
I have never done anything in Crystal Reports before today, and probably never will again. We have a client who used Crystal Reports 8.5 to generate and distribute their reports over the web. Unfortunately, it does not appear that CR 8.5 Enterprise will work on a 2003 Server, so we are installing CrystalReports 10. We have already made a lot of progress with configuration, but now we are at the code section where I am admittely very weak having never worked with CR before. Here is the code snippet, and my questions can be found below:
Set objFactory = CreateObject("CrystalRepor
Set Session("objFactory") = objFactory
Set rptAppSession = objFactory.CreateObject("C
' The name of the ReportAppServer is specified in clientSDKOptions.xml
rptAppSession.Initialize
Set Session("rptAppSession") = rptAppSession
'If Not IsObject (session("oApp")) Then
'Set session("oApp") = Server.CreateObject("Cryst
'End If
Path = Request.ServerVariables("P
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Set session("oRpt") = rptAppSession.CreateServic
Session("oRpt").Open path & reportname
If Err.Number <> 0 Then
Response.Write "Error Occurred Creating Report Object: " & Err.Description & "<BR>" & CS_CLOSEMSG
'response.Write("<Br>" & path & reportname)
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
End If
if err.number = 0 and not bolHideLogo then
on error resume next
session("oRpt").Sections.i
if err.number <> 0 then err.Clear()
on error goto 0
end if
'session("oRpt").MorePrint
'session("oRpt").EnablePar
'session("oRpt").DiscardSa
oADOConnection.Open(CS_PRO
'response.Write request.QueryString("filte
'response.end
Set oADORecordset = oADOConnection.Execute(req
Set oRptTable = session("oRpt").Database.T
oRptTable.SetPrivateData 3, oADORecordset
Question 1: Right now, I am getting an error message:
Microsoft VBScript runtime error '800a0009'
Subscript out of range
/sw_reporting.asp, line 150
When I attempt to run the code. Line 150 is: oRptTable.SetPrivateData 3, oADORecordset
Question 2: Is there a CR10 equivalent for:
'session("oRpt").MorePrint
'session("oRpt").EnablePar
'session("oRpt").DiscardSa
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.