Solved

Setting Crsytal Reports Printer at runtime in VB.NET

Posted on 2013-05-30
2
2,214 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
2 Comments
 
LVL 69

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.

757 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

22 Experts available now in Live!

Get 1:1 Help Now