Solved

print crystal report to non default printer

Posted on 2013-12-21
4
1,276 Views
Last Modified: 2013-12-23
Hi Experts
I would like to print my crystal report to non default printer on my machine.
I have tried the following codes
    CrystalReportViewer1.ReportSource = mrptDoc
        mrptDoc.PrintOptions.PrinterName = printer_selected

      CrystalReportViewer1.PrintReport()

Open in new window


printer_selected is non default printer, but it still prints to default printer.

Thanks
0
Comment
Question by:b001
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
Can you set the printer for the viewer?

Try using the print method on the report object

mrptDoc.PrintToPrinter(1, false, 0, 0);

Public Overridable Sub PrintToPrinter(ByVal nCopies As Integer, ByVal collated As Boolean, ByVal startPageN As Integer, ByVal endPageN As Integer)


Parameters
nCopiesIndicates the number of copies to print.

collatedIndicates whether to collate the pages.

startPageNIndicates the first page to print.

endPageNIndicates the last page to print.

Remarks

To print all pages, set the startPageN and endPageN parameters to zero.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Added Crystal Reports topic

mlmcc
TA
0
 

Author Comment

by:b001
Comment Utility
hi
still selects default printer.

when execute the following line
 CrystalReportViewer1.PrintReport()


it opens the Print Dialog and it has default printer selected.

Thanks
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

17 Experts available now in Live!

Get 1:1 Help Now