HTML code example

The following HTML code demonstrates one means of embedding the Report Viewer for ActiveX in a web page using the OBJECT tag:


<OBJECT ID="CRViewer"

    CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"

    WIDTH=100% HEIGHT=99%

    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,5,0,67">

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

        CRViewer.ReportName = "http://casper:80/crystal/enterprise/admin/en/viewrpt.cwr?id=121"

    else

        Dim webSource0

        Set webSource0 = CreateObject("WebReportSource.WebReportSource")

        webSource0.ReportSource = webBroker

        webSource0.URL = "http://casper:80/crystal/enterprise/admin/en/viewrpt.cwr?id=121"

        webSource0.PromptOnRefresh = True

        

        CRViewer.ReportSource = webSource0

    end if

    CRViewer.ViewReport

End Sub


-->

</SCRIPT>


Remarks

This example displays a Group Tree to allow Smart Navigation. Additionally, the user can drill-down on summary reports, refresh report data, and print the report to a printer.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com