简体   繁体   中英

C# Crystal Report printing original report page size ignored

I am creating application in c# to print Crystal report rpt with the following code.

ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(rptlocation);
rptDoc.PrintOptions.PrinterName = "Printername";
rptDoc.PrintToPrinter(1, false, 0, 0);

The issue here is that when printed, the page becomes full A4 (filling half top and half empty below), as well as when exported to PDF. The result I expect is it should print as given, but it seems ignoring the original page size, which is half.

It's worth noting that the page size of the original rpt is half A4. When previewed in Crystal Report, it is in half too which is correct. And an export to PDF, too it is correct.

Anyone pls help. Thanks a lot

右键单击水晶报表中的任意位置,然后选择“设计”,然后单击“页面设置”,然后单击该选项,您可以在其中选择是否使用默认打印机设置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM