Setting margins while printing Crystal reports.
Crystal reports provides its own printing method, which will print the page but there might be some problems in the print out unless you set the margins for the page.
PrinttoPrinter method of Crystal reports
PageMargins margins = new PageMargins(); ' Get the PageMargins structure and set the ' margins for the report. margins = rep.PrintOptions.PageMargins; margins.bottomMargin = 350; margins.leftMargin = 350; margins.rightMargin = 350; margins.topMargin = 350; ' Apply the page margins. rep.PrintOptions.ApplyPageMargins(margins); ' Print the report. Set the startPageN and endPageN 'parameters to 0 to print all pages. rep.PrintToPrinter(1, False, 0, 0); |
PrinttoPrinter method of Crystal reports