I have looked at the examples on reporting, and have some reports running… however, all the examples that I have seen have an intermediate step of a printer request dialog… how can I skip this step and have my program print directly to either a printer or file (.pdf) output without going through a requester each time?
So, no one know, or there is no way to do this??
I can’t remember how to do this right off the top of my head. The good news is there is a way to do it, and it is relatively painless. Give me a couple of days to get back to my home country and I’ll answer your question if no one else has (It is in my ‘I Wish I Knew How To… Program Access with Xojo in Windows’ book, but I don’t have a copy of it with my right now.)
Instead of OpenPrinterDialog, use OpenPrinter.
Alex is correct. Here is some example code with his suggestion:
[code] Dim g as Graphics
Dim ps As New PrinterSetup
ps.MaxHorizontalResolution = -1
ps.MaxVerticalResolution = -1
g = OpenPrinter(ps)
If rs = Nil Then
MsgBox “There is no data in the recordset. Printing Cancelled”
If g <> Nil Then
Dim Rsq as New Reports.RecordSetQuery(rs) 'Put the records into a Reports.DataSet
If rpt.Run( Rsq , ps ) Then 'check to make sure the report runs
rpt.Document.Print(g) 'Print the report