Link to home
Start Free TrialLog in
Avatar of kinton
kinton

asked on

Printer options

I wasn't sure whether to put this under Crystal or VB, so if you think it is more of a VB question please say and i'll re-post it there or request it be moved....


We are using the crystal viewer in a VB and VBA environment. Our report appears within the crystal viewer without problem. However, we have need to print the report to different printers AND to specify the printer tray.
However, when you click the print icon, Crystal picks up the default printer and not only does not allow you to select a different printer but also does not allow you to select a tray for the printer in question.

Is there away to get the printer options box to display instead of directly printing using all of the defaults?

Any help would be much appreciated.
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

If you are printing through an app then don't allow the crystal viewer to display the print button.  Instead provide your own printing functionality.  I've done this exact thing but in VB.Net so I'm hoping it translates.  Display your own printdialog and then copy the printersettings from the printdialog to your reportdocument's printsettings.  You can also override the papersource (there may be some issues if your printer is an HP but that's a separate discussion)
Avatar of Mike McCracken
Mike McCracken

I have a limited printer options form I built and code to use it if interested.

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of vidru
vidru

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kinton

ASKER

Thanks for your replies - got sidetracked with something else, sorry!

I wouldnt mind having a look at your code mlmcc - even if I don't use it in this instance it may be handy for some other printing issues we'll soon be attempting to implement.


Thanks for your code vidru.  I'm going to give this a go - hopefully soon, once i've got a report im doing out of the way.  I wont forget the post, it just might take me a few days.

Avatar of kinton

ASKER

One quick question, what is crxRpt defined as?
ReportDocument
That's the report object.  In the General Declarations section of the form module where the report will be printed, I usually declare the Application and Report objects there:

Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report

Private Sub Form_Load()
  Set crxRpt = crxApp.OpenReport("Report1.rpt")

  etc.......

-dave
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial