Hi friends,
I am using crystal report 8.5. I wanted to print the report without viewing at client. I have tried all the possbile ways with the code provided by seagate. I could't print it out. Here is the code that i use!.
Any help will be appreciated....
<HEAD>
<TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
WIDTH=0% HEIGHT=0%
CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=2,2,4,37">
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=0>
<PARAM NAME="EnableDrillDown" VALUE=0>
<PARAM NAME="EnableSearchControl" VALUE=0>
<PARAM NAME="EnableAnimationControl" VALUE=0>
<PARAM NAME="EnableZoomControl" VALUE=0>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
dim timer
dim printerTimer
dim pageOne
PageOne = True
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
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."
CRViewer.ReportName = Location.Href
else
Dim webSource
Set webSource = CreateObject("WebReportSource.WebReportSource"
webSource.ReportSource = webBroker
webSource.URL = "testrep.rpt"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
'crviewer.PrintReport
End Sub
Sub CRViewer_DownloadFinished(byval downloadType)
if downloadType = 1 and PageOne then
PageOne = False
timer = window.settimeout("OnMyTimeOut",1000)
end if
end sub
Sub OnMyTimeOut()
if not CRViewer.IsBusy then
window.ClearTimeout(timer)
CRViewer.PrintReport
printerTimer = window.SetTimeOut("OnPrinterTimeOut", 1000)
end if
end sub
Sub OnPrinterTimeOut()
if not CRViewer.IsBusy then
window.ClearTimeOut(printerTimer)
window.History.Back
end if
end sub
-->
</SCRIPT>
</BODY>
</HTML>
I am using crystal report 8.5. I wanted to print the report without viewing at client. I have tried all the possbile ways with the code provided by seagate. I could't print it out. Here is the code that i use!.
Any help will be appreciated....
<HEAD>
<TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
WIDTH=0% HEIGHT=0%
CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=2,2,4,37">
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=0>
<PARAM NAME="EnableDrillDown" VALUE=0>
<PARAM NAME="EnableSearchControl" VALUE=0>
<PARAM NAME="EnableAnimationControl" VALUE=0>
<PARAM NAME="EnableZoomControl" VALUE=0>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
dim timer
dim printerTimer
dim pageOne
PageOne = True
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
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."
CRViewer.ReportName = Location.Href
else
Dim webSource
Set webSource = CreateObject("WebReportSource.WebReportSource"
webSource.ReportSource = webBroker
webSource.URL = "testrep.rpt"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
'crviewer.PrintReport
End Sub
Sub CRViewer_DownloadFinished(byval downloadType)
if downloadType = 1 and PageOne then
PageOne = False
timer = window.settimeout("OnMyTimeOut",1000)
end if
end sub
Sub OnMyTimeOut()
if not CRViewer.IsBusy then
window.ClearTimeout(timer)
CRViewer.PrintReport
printerTimer = window.SetTimeOut("OnPrinterTimeOut", 1000)
end if
end sub
Sub OnPrinterTimeOut()
if not CRViewer.IsBusy then
window.ClearTimeOut(printerTimer)
window.History.Back
end if
end sub
-->
</SCRIPT>
</BODY>
</HTML>