Print Crystal Report, ASP
We want to print a crystal report without viewing the report first. We were able to set up the code below which brings up the Print Dialog box. How can I do this without the user seeing the print dialog box?
ASP + Crystal Reports 8
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 = "http://X/X/<%=Request.QueryString("FILE")%>"
webSource.PromptOnRefresh = True
webSource.AddParameter "prompt0", "<%=Request.QueryString("Prompt0")%>"
webSource.AddParameter "prompt1", "<%=Request.QueryString("Prompt1")%>"
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
Sub CRViewer_DownloadFinished(byval downloadType)
if downloadType = 1 and PageOne then
PageOne = False
CRViewer.PrintReport
'timer = window.setTimeout("OnMyTimeOut",1000)
end if
end sub
THANKS!!!
|