如何将crystalreoprtviewer发送到直接打印 [英] how to send crystalreoprtviewer to direct printing

查看:94
本文介绍了如何将crystalreoprtviewer发送到直接打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码

frmPreviewReports Preview = new frmPreviewReports();   //This form contain report viewer   (line 1)
SalesInvoice SInvoice = new SalesInvoice();   //this is the report document (line2) 
Preview.RptViewer.ReportSource = SInvoice (line 3)

Preview.Show(); // this preview the report  (line 4)
Preview.RptViewer.PrintReport();  // this prompt the printing dialog  (line 5)


但我想将报告发送为直接打印,而没有提示打印对话框.
我的意思是(将一行替换为第4行)


but I would like to send the report to direct print without prompt printing dialog.
I mean (replace a single line to line 4)

How to do this ?

推荐答案

CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();// this is the object of ReportDodument

    string repName = string.Empty;

    repName = CrystalReportSource1.ReportDocument.FileName;//put here your SalesInvoice with its Namespace.SalesInvoice

    report.Load(repName); 

    report.PrintToPrinter(1, false, 0, 0); 



它会将您的报告文档直接发送到打印机,而不会看到它.

希望对您有帮助...



It will send your report document direct to the printer without seeing it.

Hope it will help...


这篇关于如何将crystalreoprtviewer发送到直接打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆