Printing Report

Im using the Crystal Report Viewer in my Visual Basic 6 Applicaton. When a user clicks the print button on the Viewer they only have the option to print to the default printer.

How can I get it so the user can select which installed printer to print to?
LVL 1
Terry RogersIT Technical ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dylanyeeCommented:
which version of CR are you using?
When I click the print button from report viewer, it always pop up a print option and let me choose which printer to print to.

dylan
Terry RogersIT Technical ArchitectAuthor Commented:
Im using version 10 profesional.
dylanyeeCommented:
I am using CR9 with .Net 2003, when print from report viewer, it pop up an option which list down all the printers that already installed into my pc. I am not sure about VB6, but I think CR 10 should support it anyway.

dylan
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Terry RogersIT Technical ArchitectAuthor Commented:
How would I enable this feature?
dylanyeeCommented:
I didn't do anything to enable this feature, it is attached to the print button of CR Report Viewer.
When you click the print button, will it give you a pop up? or directly print to printer? if there is a pop up, what options can you see from the pop up?

dylan
RickJCommented:
I use CR9 and Delphi, so I bit different again but,
The behaviour for the CR Viewer is as you suggest, it only shows the default printer.
There is a function called PrinterSetupEx() of the report definition that pops up a window listing all the printers (more like the normal print dialog). And sets the printer to the one selected.
I call this function in the click event of the printer button of the viewer. This seems to work fine.
This may or may not be similar in CR10/VB6
Maybe check for the existence of the PrinterSetupEx() function.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Terry RogersIT Technical ArchitectAuthor Commented:
ok, I do indeed have the PrinterSetupEx function, however is requires a parameter...

PrinterSetupEx(hWnd as Long) As Long

Any ideas on that?
Terry RogersIT Technical ArchitectAuthor Commented:
ok, sorted. Thanks for your helps guys!

need to call it as follows ...

Report.PrinterSetupEx (hWnd)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.