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