Solved

print crystal report to non default printer

Posted on 2013-12-21
4
1,304 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
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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