Solved

print crystal report to non default printer

Posted on 2013-12-21
4
1,338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39735323
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
ID: 39735348
Added Crystal Reports topic

mlmcc
TA
0
 

Author Comment

by:b001
ID: 39735581
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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