Auto Printing Report Server Reports - Page Size Issue
Hi there I have some code that is printing SSRS reports directly to a printer. I have this working, and have managed to work around getting it display in Landscape when required. however i am having trouble setting the PaperSize. The report is set to be an A3 report, yet its printing out on A4 paper even though i'm setting the PaperSize in code to the reports default paper size (which is A3). oRV is the report viewer i have loaded the server report into, as you can see i am setting the Paper size of the print document to be the same as the default report paper size. I have stepped through this code and it is definitely setting the paper size to A3, but still prints in A4. Can anyone help iPrintingPage = 0; PrintDocument oPrintDoc = new PrintDocument(); Metafile page = oEmfImage[iPrintingPage]; oPrintDoc.PrinterSettings.PrinterName = sPrinter; oPrintDoc.PrinterSettings.DefaultPageSettings.PaperSize = oRV.ServerReport.GetDefaultPageSettings().PaperSize; if (page.Width > page.Height) { oPrintDoc.PrinterSettings.DefaultPageSettings.Landscape = true; } oPrintDoc.PrintPage += new PrintPageEventHandler(oPrintDoc_PrintPage); oPrintDoc.Print();
July 15th, 2011 12:57am

*bump*
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2011 6:21pm

Changed oPrintDoc.PrinterSettings.DefaultPageSettings.PaperSize = oRV.ServerReport.GetDefaultPageSettings().PaperSize; to oPrintDoc.DefaultPageSettings.PaperSize = oRV.ServerReport.GetDefaultPageSettings().PaperSize; and it now works
July 18th, 2011 7:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics