调用打印报表到文件,不显示对话框

 1     args                args;
 2     ReportRun           rr;
 3     Report              rb;
 4     PrintJobSettings    pjs;
 5 ;
 6     args= new Args("Report");
 7     args.record(common));
 8     args.parmEnum(PrintCopyOriginal::OriginalPrint);
 9 
10 
11     rr = new ReportRun(Args);
12     rb  = rr.report();
13     rr.suppressReportIsEmptyMessage(true);  // no more "Report is empty..." stuff
14     pjs = rr.printJobSettings();
15     pjs.virtualPageHeight(0);
16     pjs.fitToPage(true);
17 
18 
19     rb.interactive(false);
20     rr.query().interactive(false);
21     pjs.setTarget(PrintMedium::File);
22     pjs.viewerType(ReportOutputUserType::HTML);
23     rr.init();
24     pjs.setTarget(PrintMedium::File);
25     pjs.viewerType(ReportOutputUserType::HTML);
26     pjs.format(printFormat::HTML);
27 
28     pjs.fileName(@"fileName");
29     rr.run();

 

posted @ 2013-09-12 13:05  止在入门  阅读(526)  评论(0编辑  收藏  举报