Link to home
Start Free TrialLog in
Avatar of gexen
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("CrystalReports.ObjectFactory")
  Set Session("objFactory") = objFactory
  Set rptAppSession = objFactory.CreateObject("CrystalReports.ReportAppSession")
  ' 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("CrystalReports.ReportAppSession")
  'End If                                                              

  Path = Request.ServerVariables("PATH_TRANSLATED")                    
  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.CreateService("CrystalClientDoc.ReportClientDocument")
  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.item(CINT(intGP)).AddPictureObject path & "logos\" & strLogoName, 720, 10
    if err.number <> 0 then err.Clear()
    on error goto 0
  end if
 
  'session("oRpt").MorePrintEngineErrorMessages = False
  'session("oRpt").EnableParameterPrompting = False
  'session("oRpt").DiscardSavedData

  oADOConnection.Open(CS_PROVIDER)
  'response.Write request.QueryString("filter") & strORDER
  'response.end
 
  Set oADORecordset = oADOConnection.Execute(request.QueryString("filter") & strORDER)
  Set oRptTable = session("oRpt").Database.Tables.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").MorePrintEngineErrorMessages = False
  'session("oRpt").EnableParameterPrompting = False
  'session("oRpt").DiscardSavedData

ASKER CERTIFIED SOLUTION
Avatar of ebolek
ebolek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial