CR 8.5 - > CR10 Conversion

Posted on 2004-11-09
Last Modified: 2011-09-20
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

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

  'response.Write request.QueryString("filter") & strORDER
  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

Question by:gexen
    1 Comment
    LVL 10

    Accepted Solution

    You are using Enterprise language. I have CR10 and using runtime customization with it. But looks like very similar

    Yes there is cr10 conversion for this but it is different object model. Enterprise gives you more availability to do runtime customizations.

    Here is how I do it in 10
    using CrystalDecisions.CrystalReports.Engine;
    ReportDocument myreport = new ReportDocument();
    myreport.discardsavedData = false;
    myreport.enableParameterPrompting = true;


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now