how can i use the print command dialog box available in VB 6.0 to print crystal reports ??
i want the flexibity at run time to change the printer and also send reports via fax or e-mail them . or is there any other way out to do the same
Printable View
how can i use the print command dialog box available in VB 6.0 to print crystal reports ??
i want the flexibity at run time to change the printer and also send reports via fax or e-mail them . or is there any other way out to do the same
make your own with a listbox using this code to help you
Code:' Load all printers into the listbox of printers.
' Select in the listbox the current default printer.
For Each Prntr In Printers
ListBox1.AddItem Prntr.DeviceName
If Prntr.DeviceName = Printer.DeviceName _
Then ListBox1.Selected(ListBox1.ListCount - 1) = True
Next
' Find the printer selected by the user in the list of all
' printers, and select that printer.
For Each Prntr In Printers
If Prntr.DeviceName = ListBox1.List(SubSP) Then
Set Printer = Prntr
Exit For
End If
Next
Hi there,Quote:
Originally posted by larryn
make your own with a listbox using this code to help you
Code:' Load all printers into the listbox of printers.
' Select in the listbox the current default printer.
For Each Prntr In Printers
ListBox1.AddItem Prntr.DeviceName
If Prntr.DeviceName = Printer.DeviceName _
Then ListBox1.Selected(ListBox1.ListCount - 1) = True
Next
' Find the printer selected by the user in the list of all
' printers, and select that printer.
For Each Prntr In Printers
If Prntr.DeviceName = ListBox1.List(SubSP) Then
Set Printer = Prntr
Exit For
End If
Next
As a crystal report expert, I think you could help me.
I want to open the crystal report in the crystal report program, when the user clicks a command button.
Very simple, but don't know.
Your help would be greatly appreciated.
Thank you.
Rathi
add the crystal report control to your form
and right click on the control.
choose properties and on the general tab
make sure that To Window is the option chosen.
name the control crpt or whatever you like..
and attach this code to a command button
Use_ReportsPath is the path to my reports folder
at this time the report will print on screenCode:'print report
crpt.ReportFileName = Use_ReportsPath & "MyReport.rpt"
crpt.PrintReport
hope this helps you out
Quote:
Originally posted by larryn
add the crystal report control to your form
and right click on the control.
choose properties and on the general tab
make sure that To Window is the option chosen.
name the control crpt or whatever you like..
and attach this code to a command button
Use_ReportsPath is the path to my reports folder
at this time the report will print on screenCode:'print report
crpt.ReportFileName = Use_ReportsPath & "MyReport.rpt"
crpt.PrintReport
HI there,
Thanks for your valuable time and support.
I opened the Crystal report in the crystal report program, using the shell function.
Thanks again.
Rathi
hope this helps you out