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 Senior EngineerAsked:
Who is Participating?
 
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.
0
 
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
0
 
Terry RogersIT Senior EngineerAuthor Commented:
Im using version 10 profesional.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
0
 
Terry RogersIT Senior EngineerAuthor Commented:
How would I enable this feature?
0
 
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
0
 
Terry RogersIT Senior EngineerAuthor Commented:
ok, I do indeed have the PrinterSetupEx function, however is requires a parameter...

PrinterSetupEx(hWnd as Long) As Long

Any ideas on that?
0
 
Terry RogersIT Senior EngineerAuthor Commented:
ok, sorted. Thanks for your helps guys!

need to call it as follows ...

Report.PrinterSetupEx (hWnd)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.