Solved

print crystal report to non default printer

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

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 101

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

628 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