Select a printer, print Report, and close
I have created a Report with a ListBox that lists all available Printers on my computer.
I would like to be able to click on a Printer, and have the Report printed to that Printer, and then close. Here's what I have so far:
Private Sub lstPrinters_Click(ByVal sender As object, ByVal e As EventArgs) 'Handles lstPrinters.SelectedIndexChanged
Report.PrintSettings.Printer = lstPrinters.SelectedItem.ToString 'WORKS - sets the Printer to the one I selected.
' NOW WHAT?
' Report.PrintPrepared()
' report.Prepare()
' Report.Print()
' Report.Dispose()
' Report.PrintPrepared
End Sub
What code do I have to add to accomplish this?
I would like to be able to click on a Printer, and have the Report printed to that Printer, and then close. Here's what I have so far:
Private Sub lstPrinters_Click(ByVal sender As object, ByVal e As EventArgs) 'Handles lstPrinters.SelectedIndexChanged
Report.PrintSettings.Printer = lstPrinters.SelectedItem.ToString 'WORKS - sets the Printer to the one I selected.
' NOW WHAT?
' Report.PrintPrepared()
' report.Prepare()
' Report.Print()
' Report.Dispose()
' Report.PrintPrepared
End Sub
What code do I have to add to accomplish this?