
Crystal Reports On The Web
Hi All,
Not a stricktly VB question (but can't find an exact newsgroup) and one that
has been asked many times I know...... But....
I use the Active X viewer very sucessfully in an Access ADP - no problem.
However, I am currently undertaking a project to move the database in
question to a web interface using Coldfusion MX.
All I would like to be able to do is call a report into the viewer and pass
paremeters where required etc. I was hoping to do this without getting
involved in ASP, as the system is CF based.
I have the code below so far. The code works as much in that is creates an
instance of the active x control, but with no report in it. I am unsure as
to how to call a specific report and set the parameters for that matter. I
would be hugely grateful if someone could assist.
Many many thanks.
Steve
<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
CLASSID="CLSID:2DEF4530-8CE6-41c9-84B6-A54536C90213"
WIDTH=100% HEIGHT=100%
CODEBASE="/viewer9/activeXViewer/activexviewer.cab#Version=9,2,0,442"
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
CRViewer.ReportName =
"C:\Data\MasterWTPDatabase\CrystalReports\BookSalesReports\BookSalesOverTime
.rpt"
Set webBroker = CreateObject("WebReportBroker9.WebReportBroker")
If ScriptEngineMajorVersion < 2 Then
window.alert "IE 3.02 users need to get the latest version of VBScript or
install IE 4.01 SP1 or newer. Users of Windows 95 additionally need DCOM95.
These files are available at Microsoft's web site."
else
Dim webSource
Set webSource = CreateObject("WebReportSource9.WebReportSource")
webSource.ReportSource =
"C:\Data\MasterWTPDatabase\CrystalReports\BookSalesReports\BookSalesOverTime
.rpt"
webSource.URL =
"C:\Data\MasterWTPDatabase\CrystalReports\BookSalesReports\BookSalesOverTime
.rpt"
webSource0.PromptOnRefresh = True
CRViewer.ReportSource = webSource
End If
CRViewer.ViewReport
End Sub
</SCRIPT>
</BODY>
</HTML>