Link to home
Start Free TrialLog in
Avatar of mgmhicks
mgmhicks

asked on

Printing Crystal Report Directly to printer

I am using the following code to bring up a crystal report in a acrobat reader format and display it in the browser.  What I would like to do is take same report, but do not display it, just print it direclty to their default printer.  Here is the existig codel

Dim msubReport = crReport.Subreports.Item(0)
        Dim crSubDatabase = crReport.Subreports.Item(0).Database
        Dim crSubTables = crReport.Subreports.Item(0).Database.Tables
        Dim crSubTable As Table

        mSubCount = crReport.Subreports.Count

        If mSubCount > 0 Then
            For Each crSubTable In crSubTables
                crTableLogOnInfo = crSubTable.LogOnInfo
                crTableLogOnInfo.ConnectionInfo = crConnectionInfo
                crSubTable.ApplyLogOnInfo(crTableLogOnInfo)
            Next
        Else
        End If

        mem = crReport.ExportToStream(ExportFormatType.PortableDocFormat)
        Response.Clear()
        Response.Buffer = True
        Response.ContentType = "application/pdf"
        Response.BinaryWrite(mem.ToArray)
        Response.End()
ASKER CERTIFIED SOLUTION
Avatar of surajguptha
surajguptha
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also check this link out
http://forums.asp.net/p/1074317/1576492.aspx

Has a lot of discussion around the subject...