Solved

Setting Crsytal Reports Printer at runtime in VB.NET

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

627 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