I am trying to use the following code in VS.NET 2005 to run crystal reports using the activex viewer control. This code does not give me any errors, but it doesn't show the report either. I am not sure how to make this work. I use the message box funtion
to see the contents of webSource0.URL after setting it to the report, but it is always blank. This could be the problem, but I don't know how to fix it. Please help. Any help is greatly appreciated.
<script type="text/vbscript" language="VBScript">
<!--
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if err.number <> 0 then
window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available
at Microsoft's web site."
CRViewer.ReportName = "http://localhost/Test/TestVP-Run.rpt"
else
Dim webSource0
Set webSource0 = CreateObject("WebReportSource.WebReportSource")
webSource0.ReportSource = webBroker
webSource0.URL = "http://localhost/Test/TestVP-Run.rpt"
webSource0.PromptOnRefresh = True
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport
End Sub
-->
</script>
coolvaas1
Participant
938 Points
435 Posts
Crystal report ActiveX viewer control
Aug 22, 2008 08:26 PM|LINK
I am trying to use the following code in VS.NET 2005 to run crystal reports using the activex viewer control. This code does not give me any errors, but it doesn't show the report either. I am not sure how to make this work. I use the message box funtion to see the contents of webSource0.URL after setting it to the report, but it is always blank. This could be the problem, but I don't know how to fix it. Please help. Any help is greatly appreciated.
<OBJECT ID="CRViewer" CLASSID="CLSID:6F1232F7-0D44-11C3-BF07-4791173FAA04" WIDTH="100%" HEIGHT="95%"
CODEBASE="/crystalreportviewers115/ActiveXControls/ActiveXViewer.cab#Version=11,5,8,826" VIEWASTEXT>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" VALUE=0>
</OBJECT>
<script type="text/vbscript" language="VBScript">
<!--
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if err.number <> 0 then
window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
CRViewer.ReportName = "http://localhost/Test/TestVP-Run.rpt"
else
Dim webSource0
Set webSource0 = CreateObject("WebReportSource.WebReportSource")
webSource0.ReportSource = webBroker
webSource0.URL = "http://localhost/Test/TestVP-Run.rpt"
webSource0.PromptOnRefresh = True
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport
End Sub
-->
</script>