Solved

Setting Crsytal Reports Printer at runtime in VB.NET

Posted on 2013-05-30
2
2,342 Views
Last Modified: 2013-11-15
On my old development PC (Win7Pro / Vb.NET 2008 / CR) I had a routine that allowed users to print a selection of documents using pre-defined crsytal report templates.
Basically we could setup a list of documents to print and configure the printers that they were printed to.
Now I have a Windows8 PC with Vb.NET 2010 and CR 2011, this code is no longer working.
It appears that the CR object ignores the printer parameters and prints to the default windows printer. The code I used was very simple:
 
       ' Set the required Printer & Tray
        crxReport.PrintOptions.PrinterName = oDocParams.PrinterName
        crxReport.PrintOptions.PaperSource = oDocParams.PrinterTray

However is doesn't matter what you set the printer name to (and yes I am setting to printers configured on the PC!) likewise for the tray.
The only thing that appears to work is the number of copies:
       crxReport.PrintToPrinter(oDocParams.Copies, True, 0, 0)

I am referencing the full blown crystal report object not hte one included in .NET

I'm guessing the printing subsystem in Windows 8 is overiding the CR settings......

Anyone have any ideas?

Thanks

Patrick
0
Comment
Question by:ManSys UK
[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 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 39207221
maybe try to change the default printer just to print the report (and reset it right after): http://emoreau.com/Entries/Articles/2005/03/Setting-Windows-default-printer.aspx
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39207548
It may also be that Crystal needs to be upgraded to be fully Win8 compatible.

A couple of articles from SAP/Crystal.  No Win 8 Crystal service pack yet.
http://scn.sap.com/thread/3296726

http://scn.sap.com/message/13996287

mlmcc
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

734 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