Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vb6 and Crystal 8.5 2

Status
Not open for further replies.

azrobert

Programmer
Apr 27, 2002
392
US
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.......
 
Cool!

I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
 

Thank you, How the Invoice is defined ...(Dim Report as New Invoice).

Regards, Biju
 
azrobert, does your method of printing above allow the user to specify the pages to print?

Thanks, David Abineri

 
Had never thought of that and just checked

It does not. there might be a way to specify that
dialog but have not looked in to it yet.


Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top