Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 633
  • Last Modified:

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?
0
Terry Rogers
Asked:
Terry Rogers
  • 4
  • 3
1 Solution
 
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
 
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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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
 
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
 
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now