Click to See Complete Forum and Search --> : Only Report viewer is Opening


Andy0000
November 29th, 2007, 03:08 AM
Guys I am using the usual ASP code to generate a report. My problem is only the report viewer is opening. And its not able to open the The report.
Please guys help required is urgent. Thanks in advance
My code is as following:

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