Solved

Setting Crsytal Reports Printer at runtime in VB.NET

Posted on 2013-05-30
2
2,237 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
A list of useful business intelligence software.
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

911 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

25 Experts available now in Live!

Get 1:1 Help Now