打印水晶报表 [英] Printing a Crystal Report

查看:88
本文介绍了打印水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,

我想通过按钮打印CrystalReportViewer控件中存在的报告.
我写了

Hello Sir,

I want to print a report present in CrystalReportViewer Control through a Button.
I Wrote

CrystalReportViewer1.PrintReport();




然后它显示PrintDialog Box.我不要那个对话框.我想要可以正常工作的机器上可用的任何默认打印机.并直接打印出来.
只想跳过打印对话框.

在此先感谢




then It shows the PrintDialog Box. I don''t want that dialog box. I want whatever default printer is available in the machine that should work. and directly the print out.
just want to skip the print Dialog Box.

Thanks in advance

Actually I am printing the report from different form of c# and using some criteria. I don't want to use ReportDocument any other way by using CrystalReportViewer only.
Than will help me.
my code is:
  <pre>BillReportPrint br = new BillReportPrint();
            br.MdiParent = this.MdiParent;
            br.textBox1.Text = textBox2.Text;
            br.crystalReportViewer1.PrintReport();
</pre>
don't want the PrintDialog Box

推荐答案

PrintReport方法还为您提供了选择要打印的页面范围的选项,或者全部,或指定范围.
在不显示对话框的情况下进行打印
1.在表单中添加CommandButton.
2.在按钮的Click事件中,放置以下代码:
3. DataReport1.PrintReport错误
或者,要指定要打印的页面范围,请使用以下代码:
DataReport1.PrintReport False,rptRangeFromTo,1、2
例如:-
The PrintReport method also gives you the option of selecting a range of pages to print, either all, or a specified range.
To print without displaying the dialog box
1. Add a CommandButton to a Form.
2. In the button''s Click event, place the following code:
3. DataReport1.PrintReport False
Or, to specify a range of pages to print, use the code below:
DataReport1.PrintReport False, rptRangeFromTo, 1, 2
Ex:-
ReportDocument rd = new ReportDocument();
rd.Load("Path of .rpt file");
crystalReportViewer1.ReportSource = rd;
crystalReportViewer1.Refresh();
rd.PrintToPrinter(1, false, 0, 0);


看看那里 [


take a look there[^] for more details.


您在这里

在ASP.NET中自动打印Crystal报表 [ ^ ]

它包含服务器和服务器的两种方式.客户端.
Here you go

Automatically Printing Crystal Reports in ASP.NET[^]

It contains two ways both server & client side.


这篇关于打印水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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