?
Solved

CR 8.5 - > CR10 Conversion

Posted on 2004-11-09
3
Medium Priority
?
610 Views
Last Modified: 2011-09-20
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

0
Comment
Question by:gexen
1 Comment
 
LVL 10

Accepted Solution

by:
ebolek earned 2000 total points
ID: 12557566
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;

Regards
Emre
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

839 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