Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal Report is not able to open in ASP page Post Reply Post New Topic
Author Message
Andy0000
Newbie
Newbie
Avatar

Joined: 29 Nov 2007
Location: India
Online Status: Offline
Posts: 1
Quote Andy0000 Replybullet Topic: Crystal Report is not able to open in ASP page
    Posted: 29 Nov 2007 at 12:36am
Hi Guys,
I have developed a simple application in which I am opening a crystalreport in an ASP page. My problem is that crystal viewer opens in my browser but it is not able to load the specific crystal report file. Only the crystal report viwer opens.

Help required is very urgent. Thanks in advance

I am using the following code:

<%@ LANGUAGE="VBSCRIPT" %>

<title></title>

<%

'=======================================================================

' WORKING WITH THE REPORT DESIGNER COMPONENT AND ASP TO PREVIEW A REPORT

'=======================================================================

 

reportname = "crystalset.rpt"

' - 1 -                                                         

' CREATE THE APPLICATION OBJECT                                                                   

If Not IsObject (session("oApp")) Then                             

Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")

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

 

'Response.Write path & "report\" & reportname

'Response.End

'session("oApp").LogonServer "PDSODBC.DLL", Cstr("GEMSquotetest"), Cstr("REWARDS_SCALING"), Cstr("RWDTSTS1"), "Scaling2002"


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

'Session("oRpt").ParameterFields.GetItemByName("RTQNumber").AddCurrentValue(CStr("tedCORPRHOgq531"))

 

'This Section suppress the subreport area dynamically

Dim RptSection

Dim supSection

Dim SectionOptions

 

'Get Report Section collection object

'Set RptSection = Session("oRpt").sections

 

session("oRpt").MorePrintEngineErrorMessages = False

session("oRpt").EnableParameterPrompting = False

 

'====================================================================================

' Retrieve the Records and Create the "Page on Demand" Engine Object

'====================================================================================

 

On Error Resume Next                                                 

session("oRpt").ReadRecords                                         

If Err.Number <> 0 Then                                             

  Response.Write "An Error has occured on the server in attempting to access the data source"

Else

 

  If IsObject(session("oPageEngine")) Then                             

      set session("oPageEngine") = nothing

  End If

set session("oPageEngine") = session("oRpt").PageEngine

End If

%>

<!-- #include file="SmartViewerActiveX.asp" -->
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.