Private Sub PrintReport(ByVal printerName As String)
Dim margins As PageMargins
' Get the PageMargins structure and set the
' margins for the report.
margins = Report.PrintOptions.PageMargins
margins.bottomMargin = 350
margins.leftMargin = 350
margins.rightMargin = 350
margins.topMargin = 350
' Apply the page margins.
Report.PrintOptions.ApplyPageMargins(margins)
' Select the printer.
Report.PrintOptions.PrinterName = printerName
' Print the report. Set the startPageN and endPageN
' parameters to 0 to print all pages.
Report.PrintToPrinter(1, False, 0, 0)
End Sub