In a project, the customer asked the daily report to be printed on both sides, so how to use the Crystal Report to achieve dual-sided printing;
By searching for materials, you can find an attribute in the Crystal Report object that is used to set double-sided printing.
Report. printoptions. printerduplex
Printerduplex is the crystaldecisions. Shared. printerduplex enumeration attribute and its value is
Default
; Horizontal
; Simplex;
Vertical
Use the following statement:
Crystalreport report = appmodule. getcrystalreport ("rptwaybilldayreport. rpt", this. dataset );
Report. printoptions. printerduplex = crystaldecisions. Shared. printerduplex. horizontal;
Report. Preview ();
Set to bidirectional printing. When the "print" button in the pop-up report preview window is output, it does not work.
The normal dual-sided printing should be that the printer automatically outputs all the odd pages. After the odd pages are printed, a prompt window will pop up, prompting you to manually change the paper, click "OK" to continue printing the even page;
After multiple tests, we found that printing in the Report. Preview () preview window was used, and the "double-sided printing" option in the displayed printer settings window was not set;
Therefore, if preview is not used, report. Print () is directly used. The dual-sided printing is successful!
The currentCodeYes:
Crystalreport report = appmodule. getcrystalreport ("rptwaybilldayreport. rpt", this. dataset );
Report. printoptions. printerduplex = crystaldecisions. Shared. printerduplex. horizontal;
Report. Print ();
Posted onRex. Ying reading (...) Comment (...) EDIT favorites
Refresh comment refresh page Back to Top
Blog homepage blog news flash programmer recruitment Knowledge Base
Powered by: the blog Park template provides: Hujiang blog
Copyright 2013 Rex. Ying