cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report with Classis ASP

Former Member
0 Kudos
761

I am new to both, ASP and Crystal Report, please keep that in mind while replying.

The goal is to use classic ASP to design a webpage through which invoke crystal report, pass parameters, run CR get report and display it in the PDF format.

So I downloaded trial version, for time being, and started learning ASP and CR. While browsing through this forum, I found a code which is supposed to help me in this. I downloaded and tweaked a little, but it is not working. The code is same copied in many forums, people claiming that it is working, but not for me.

The code is divided in various files. Here it goes.

SimpleReportViewer.asp - this is the file called first in browser


<%@ LANGUAGE="VBSCRIPT" %>
<%
reportname = "SimplePreviewReport.rpt"
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->     
<!-- #include file="MoreRequiredSteps.asp" -->
<!-- #include file="SmartViewerActiveX.asp" -->       

Now here is the file - AlwaysRequiredSteps.asp


If Not IsObject (session("oApp")) Then                              
  Set session("oApp") = Server.CreateObject("CrystalReports14.ObjectFactory.1")
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

On error resume next

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

If Err.Number <> 0 Then
  Response.Write "Error Occurred creating Report Object: " & Err.Description
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing
  Session.Abandon
  Response.End
End If

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
session("oRpt").DiscardSavedData

I am not typing in more code, as the error I am getting is in code above.

Now when I execute this code in IE, the error I am getting is

"Error Occurred creating Report Object: Object doesn't support this property or method"

Please help, any kind of help in getting this running will greatly appreciated

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Well, when I go to Help -> About Crystal Reports, I see following there

Copyright Notice and other blah blah blah

SAP Business Objects

CR Developer

Version 14.0.0.760 RTM

Product Type: Evaluation. Expires in 22 days.

Number of licenses: 1

So looks like I got version 14.

Please advise.

former_member184995
Active Contributor
0 Kudos

Yeah, that is CR 2011.

My previous post applies.

Good luck,

Jason

Former Member
0 Kudos

Little confused here.

Which version is the latest version of Crystal Reports?

From previous posts, it looks like 2008 is the newer version than the Crystal 2011 or XI.

former_member183750
Active Contributor
0 Kudos

CR 2011 (v14.x) is the latest. CR 2008 (v12.x) is a bit earilier \ older.

CR 2011 has no SDK included.

CR 2008 had the .NET SDK only - no RDC

CR XI R2A (11.5) is the last version to include the RDC

- Ludek

Answers (2)

Answers (2)

former_member184995
Active Contributor
0 Kudos

Hello,

Crystal Reports 2011 does not come with an SDK.

Also the COM SDK was retired after version XI R2 so it is not available with CR 2008 or 2011.

You will need to move to either Java or .NET.

If you want to use .NET you will need to use CR for VS.NET 2010 or CRJ 2.10 for Java.

Jason

former_member183750
Active Contributor
0 Kudos

Let's start with:

"So I downloaded trial version,..."

What version of CR? As far as I know only CR 2008 is available at this time as a trial version download. And that is where your problems start.

In order for you to code Classic ASP with CR, you must use the Report Designer Component (RDC). RDC has been retired in CR 2008. Last version of CR to include the RDC was CR XI R2 (11.5). Patch support for CR XI R2 terminated about a year ago and any support terminates June 30 of this year. E.g.; RDC and thus Classic ASP is not the way to go.

I would highly recommend going to an SDK (CR SDK for .NET or Java) that will be supported for years to come - particularly if you are creating a brand new solution.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]