Hi,
I am using ASP to display a Crystal Report (version 10). Here is my code :
-----------------------------------------------------------
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR">
</HEAD>
<body ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer" CLASSID="CLSID:A1B8A30B-8AAA-4a3e-8869-1DA509E8A011" WIDTH=100% HEIGHT=99%
CODEBASE="/crystalreportviewers10/ActiveXControls/ActiveXViewer.cab#Version=10,0,0,533" VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
On Error Resume Next
Dim webBroker
//Set webBroker = CreateObject("CrystalReports10.WebReportBroker.1")
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
else
Dim webSource
//Set webSource = CreateObject("CrystalReports10.WebReportSource.1")
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver10.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp");
}
</script>
<%
reportname = "TestCrystal.rpt"
If Not IsObject(session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
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
Response.Write(Path & reportname)
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
'CRViewer.ViewReport
session("oRpt").ReadRecords
'session("oRpt").ViewReport
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Number & " " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
</BODY>
</HTML>
-----------------------------------------------------------
My machine has Crystal Report v10 installed and when the code runs it displays the Crystal Viewer and the following error:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
on this line of code:
Set session("oApp") = Server.CreateObject ("CrystalRuntime.Application.10").
As crystal is not installed on the server I think it may be a dll issue. The only Crystal dll which is installed on the server is MSWCRUN.dll.
I have ActiveX Viewers installed on my local machine :
CRVIEWER.all
CSELEXPT.ocx
NPSSVIEW.dll
SINFORS.dll
SVIEWHLP.dll
SWEBRS.dll
XQVIEWER.dll
Do these need to be registered on the server also?
Are there any other dll's that need to be registered on my local machine / the server?
Please help me, my pretty little head is melted.
I am using ASP to display a Crystal Report (version 10). Here is my code :
-----------------------------------------------------------
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR">
</HEAD>
<body ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer" CLASSID="CLSID:A1B8A30B-8AAA-4a3e-8869-1DA509E8A011" WIDTH=100% HEIGHT=99%
CODEBASE="/crystalreportviewers10/ActiveXControls/ActiveXViewer.cab#Version=10,0,0,533" VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
On Error Resume Next
Dim webBroker
//Set webBroker = CreateObject("CrystalReports10.WebReportBroker.1")
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
else
Dim webSource
//Set webSource = CreateObject("CrystalReports10.WebReportSource.1")
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver10.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp");
}
</script>
<%
reportname = "TestCrystal.rpt"
If Not IsObject(session("oApp")) Then
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.10")
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
Response.Write(Path & reportname)
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
'CRViewer.ViewReport
session("oRpt").ReadRecords
'session("oRpt").ViewReport
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Number & " " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
</BODY>
</HTML>
-----------------------------------------------------------
My machine has Crystal Report v10 installed and when the code runs it displays the Crystal Viewer and the following error:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
on this line of code:
Set session("oApp") = Server.CreateObject ("CrystalRuntime.Application.10").
As crystal is not installed on the server I think it may be a dll issue. The only Crystal dll which is installed on the server is MSWCRUN.dll.
I have ActiveX Viewers installed on my local machine :
CRVIEWER.all
CSELEXPT.ocx
NPSSVIEW.dll
SINFORS.dll
SVIEWHLP.dll
SWEBRS.dll
XQVIEWER.dll
Do these need to be registered on the server also?
Are there any other dll's that need to be registered on my local machine / the server?
Please help me, my pretty little head is melted.