joeyxiaobin 发表于 2017-3-24 11:10:09

求助!ActiveReports7 直接打印后打印空白页

各位同行,现在我设计的一个功能是报表不预览直接打印,使用下列代码实现:
FinishCoilLabel_Common label3 = new FinishCoilLabel_Common(fidlist, false);                              
label3.Document.Printer.Print();


FinishCoilLabel_Common 是一个SectionReport,打印机会进行打印操作,但是打印的是空白页,为什么呢?有大神知道吗?

FinishCoilLabel_Common的构造函数中有 添加 this.Run();

但是如果通过viewer预览打印是正常的。不预览打印就出问题。

Lenka.Guo 发表于 2017-3-24 11:42:37

FinishCoilLabel_Common label3 = new FinishCoilLabel_Common(fidlist, false);                              
在这个下面加 Run方法试试

joeyxiaobin 发表于 2017-3-24 11:48:59

@Lenka.Guo 感谢回复
我试过了,也是不行
run()的代码我已经在构造函数里加了

后来我换了一种方法,不使用label3.Document.Printer.Print();
改使用 GrapeCity.ActiveReports.PrintExtension.Print(label3.Document,false,true);就可以了
但是原因一直不知道

Lenka.Guo 发表于 2017-3-24 12:21:51

label3.Document.Printer.Print(); 可能调用的是VS提供的基类,而不是AR的Print接口
页: [1]
查看完整版本: 求助!ActiveReports7 直接打印后打印空白页