Not sure if this is the appropriate forum but i have been searching for this answer for ages.....
using the Crystal rdc i needed to display a printer select option that would let the user select a printer without changing the default system printer before printing or viewing a report. I stumbled on the .printersetup method to display a printer dialog box before viewing or printing a report but the cancel button press could not be detected. There is a service pack for crystal reports that adds a .printersetupEX method that traps the cancel button press event.
I am using the following code to print a crystal report now.
Private Sub PrintInvoice_Click()
Dim dbs As Database
Dim strQuerySql As String, strQuerySql2 As String
Dim RS1 As Recordset, rs2 As Recordset,
Dim Report As New Invoice
' "sql stuff here"
If Invoice.PrinterSetupEx(0) = 0 Then
Invoice.PrintOut (False)
End If
Set RS1 = Nothing
Set rs2 = Nothing
dbs.Close
End Sub
here is the link to Crystals article
hope this will help someone.......
using the Crystal rdc i needed to display a printer select option that would let the user select a printer without changing the default system printer before printing or viewing a report. I stumbled on the .printersetup method to display a printer dialog box before viewing or printing a report but the cancel button press could not be detected. There is a service pack for crystal reports that adds a .printersetupEX method that traps the cancel button press event.
I am using the following code to print a crystal report now.
Private Sub PrintInvoice_Click()
Dim dbs As Database
Dim strQuerySql As String, strQuerySql2 As String
Dim RS1 As Recordset, rs2 As Recordset,
Dim Report As New Invoice
' "sql stuff here"
If Invoice.PrinterSetupEx(0) = 0 Then
Invoice.PrintOut (False)
End If
Set RS1 = Nothing
Set rs2 = Nothing
dbs.Close
End Sub
here is the link to Crystals article
hope this will help someone.......