Setting margins while printing Crystal reports.

10 Sep

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.

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.
‘ 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

Leave a comment

Posted by on September 10, 2008 in .NET, Crystal Reports, Problem Solving


Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: