简体   繁体   中英

C# Crystal Reports Printing Page Size Incorrect

I'm developing ac# program to print Crystal Reports document. The program takes rpt raw file and send it to printer.

ReportDocument crrpt = new ReportDocument();
crrpt.Load(pathtorptfile);

crrpt.PrintOptions.PrinterName = settings.Print_printer;
crrpt.PrintToPrinter(1, false, 0, 0);

The above code can print. The problem is the page size does not seem correct. It is different from the page size in the rpt file (when opened in Crystal Reports).

When opened in Crystal Reports, the size is half A4 (which is what I need). And printing it within Crystal, also gives the half the page. However, when I print with above code, it prints in top half page and leave the bottom half page empty. (Sample http://imgur.com/rPX9bep ).

Printing within Crystal Reports (on the left - one I need) vs Printing with above code (on the right).

Appreciate any helps. Thanks in advance.

Set your default printer paper size to A5 and orientation to landscape. Which you are using in printing code. And then try again.

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