Solved

Printing Crystal Report Directly to printer

Posted on 2007-12-06
2
451 Views
Last Modified: 2008-02-01
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()
0
Comment
Question by:mgmhicks
  • 2
2 Comments
 
LVL 21

Accepted Solution

by:
surajguptha earned 500 total points
ID: 20422872
www.codeproject.com/aspnet/crCode.asp
it contains code to print the report directly to the printer
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20422882
Also check this link out
http://forums.asp.net/p/1074317/1576492.aspx

Has a lot of discussion around the subject...
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now