Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2004, 10:38 AM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal report does not print Gtu108 Crystal Reports 1 December 15th, 2007 02:43 AM
Dot Matrix Printer does not print crystal report alok_mca07 Crystal Reports 0 October 24th, 2007 11:32 AM
Crystal Report Print sepidehsalek Crystal Reports 2 February 12th, 2005 04:58 AM
Print multiple header & footer from Crystal Report ashu_gupta75 Classic ASP Professional 0 February 6th, 2004 03:44 AM
Print (Report in ASP) mateenmohd SQL Server 2000 2 November 22nd, 2003 12:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.