Tuesday, April 1, 2008

Changing the size of paper in ActiveReports

I wanted to change the size of paper to A4. Thus I set the report's property PageSettings.PaperKind to System.Drawing.Printing.PaperKind.A4. The report designer reflected the change, but quite surprisingly I received the error when running the report:

Printer does not support A4 papersize. Please use PaperKind.Custom in your PageSettings or specify a papersize supported by the current printer

So I used PaperKind.Custom even though my printer supports A4 very well and specified the dimensions of A4 manually. What was my surprise when Adobe Acrobat Reader (viewer) still used the size of Letter! I searched ActiveReports' Support Forums and managed to find the idea of the solution: Document.Printer.PrinterName must be set to an empty string, after that you may specify both PageSettings.PaperKind and Document.Printer.PaperKind arbitrarily; the latter is esential for viewer.

1 comment:

Ryan said...
This comment has been removed by the author.