Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a Reportviewer control on my VB.NET Form, to view/print an rdl file. How can i set the page size and margin settings programmatically before printing the report ?.. Now everytime i have to set the margins at print time.. Is there any simple solution in VB.Net ?
Posted
Updated 30-Mar-17 7:46am
Comments
Member 12570679 28-Sep-17 0:51am    
this is not solution

1 solution

Try this ...

Dim newPageSettings As New System.Drawing.Printing.PageSettings
newPageSettings.Margins = New System.Drawing.Printing.Margins(40, 20, 20, 20)
reportViewer.SetPageSettings(newPageSettings)
 
Share this answer
 
Comments
Member 12570679 28-Sep-17 0:52am    
Not working setpagesetting error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900