Prashanth
Prashanth

Reputation: 13

How to Change Paper Size of a print dialog programatically C#?

I Want to Change the paper size to a user-defined paper size programatically in C# for Eg: 10x12 is my Paper Size. It is much better if you help me in how to print in Crystal Report with the paper size 10x12.

Upvotes: 0

Views: 5548

Answers (1)

Haji
Haji

Reputation: 2087

IN OnBegin Event of the print document class,set the below coding for custom paper size :

     Dim xCustomSize As New PaperSize("Custom", 10, 12)
            xCustomSize.PaperName = PaperKind.Custom

 PrintDocument.DefaultPageSettings.PaperSize =xCustomSize 

* For Crystal Report : *

MYCRYSTALREPORT crpt = new MYCRYSTALREPORT();
crpt.PrintOptions.PaperSize = xCustomSize ;

for more detail: http://social.msdn.microsoft.com/Forums/en-US/9e647fac-d5cd-42b7-a1e6-db6d6cf97c57/setting-pagesize-for-crystal-report?forum=vscrystalreports

Upvotes: 2

Related Questions