Once you have estabalished all of your parameters you can add this in the
Report Viewer:
Private Sub CRViewerPanels_PrintButtonClicked(UseDefault As Boolean)
crRep.PrinterSetup Me.hwnd
End Sub
When the printer button is clicked from the preview mode, the code in the
event will gather information from the Handler of the form. This will open
up a printer dialog box where you can select any printer that is configured
for the given workstation. You may not use it now, but it is good to have
on the shelf if you need it at a later time.
Tony
Quote:
> First of all, thank you to Ming Ma and Jawahir for helping me. I managed
to
> find out the problem why the report is not being spooled to the printer. I
> created my report in CR with "No Printer" option. This is because the
> end-user laser printers won't be the same as any of our current printers
> now.
> Just a quick question. How do I set in VB coding to print to the default
> printer? I'm using CR9, and Jawahir solution doesn't apply.
> Thank you again.
> > Hi,
> > I have used this with the cr 8 and 8.5. you can set the
> > destination to the printer as given below. I hope this
> > will solve your problem
> > Cr.Destination = crptToPrinter
> > Cr.PrintReport
> > regards,
> > jawahir
> > >-----Original Message-----
> > >I'm quite new to CR. Currently using VB6(sp5) and CR Dev
> > 9.0
> > >I've created an app with CRViewer. I can view it alright
> > in the window.
> > >However, when I click print, nothing is being sent to the
> > printer.
> > >Even if I put the code
> > >CRViewer91.PrintReport
> > >also doesn't work, i.e. nothing is send to the printer
> > (Tektronix Phaser
> > >860).
> > >I've set my printer to offline mode to capture any
> > spooling.
> > >Thanks. My coding below:
> > >Dim CRVAppl As CRAXDRT.Application
> > >Dim CRReport As CRAXDRT.Report
> > > Set CRVAppl = New CRAXDRT.Application
> > > Set CRReport = CRVAppl.OpenReport("C:\rpt_User", 1)
> > > CRReport.DiscardSavedData
> > > CRReport.Database.SetDataSource myRecordset
> > > With CRViewer91
> > > .ReportSource = CRReport
> > > .ViewReport
> > > .Visible = True
> > > .ZOrder
> > > .PrintReport
> > > End With
> > >.