如何打印水晶报表而不在c#windows应用程序中打开任何对话框。 [英] How to print the crystal report without opening any dialog in c# windows application.

查看:50
本文介绍了如何打印水晶报表而不在c#windows应用程序中打开任何对话框。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何打印水晶报告而不在C#windows应用程序中打开任何对话框。



i创建了一个报告,我想打印没有水晶报表查看器的水晶报表。



报告创建的代码是:

 RecoveryJobDataSet rjDS = 新的 RecoveryJobDataSet(); 
rjDS.Tables [ 0 ]。Rows.Add( 100000111 Vivek 100000 );
rjDS.Tables [ 0 ]。Rows.Add( 1000002222 Omkar 70000 );
rjDS.Tables [ 0 ]。Rows.Add( 1000003333 Kapil 100000 );
DataTable dt = new DataTable();
dt = rjDS.Tables [ 0 ];
CrystalReport1 report = new CrystalReport1();
report.SetDataSource(dt);

CrystalReportViewer1.ViewerCore.ReportSource = report;





我尝试过:



RecoveryJobDataSet rjDS = new RecoveryJobDataSet();

rjDS.Tables [0] .Rows.Add(100000111,Vivek, 100000);

rjDS.Tables [0] .Rows.Add(1000002222,Omkar,70000);

rjDS.Tables [0] .Rows.Add( 1000003333,Kapil,100000);

DataTable dt = new DataTable();

dt = rjDS.Tables [0];

CrystalReport1报告=新的CrystalReport1();

report.SetDataSource(dt);



CrystalReportViewer1.ViewerCore.ReportSource = report;

解决方案

删除打开查看器的行

 CrystalReportViewer1.ViewerCore.ReportSource = report; 



替换为PrintToPrinter命令,例如

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



其他选项...... 让我为你辩护 [ ^ ]


how to print the crystal report without opening any dialog in C# windows application.

i have created a report, i want to print crystal report without crystal report viewer.

report created code is:

RecoveryJobDataSet rjDS = new RecoveryJobDataSet();
           rjDS.Tables[0].Rows.Add(100000111, "Vivek", 100000);
           rjDS.Tables[0].Rows.Add(1000002222, "Omkar", 70000);
           rjDS.Tables[0].Rows.Add(1000003333, "Kapil", 100000);
           DataTable dt = new DataTable();
           dt = rjDS.Tables[0];
           CrystalReport1 report = new CrystalReport1();
           report.SetDataSource(dt);

           CrystalReportViewer1.ViewerCore.ReportSource = report;



What I have tried:

RecoveryJobDataSet rjDS = new RecoveryJobDataSet();
rjDS.Tables[0].Rows.Add(100000111, "Vivek", 100000);
rjDS.Tables[0].Rows.Add(1000002222, "Omkar", 70000);
rjDS.Tables[0].Rows.Add(1000003333, "Kapil", 100000);
DataTable dt = new DataTable();
dt = rjDS.Tables[0];
CrystalReport1 report = new CrystalReport1();
report.SetDataSource(dt);

CrystalReportViewer1.ViewerCore.ReportSource = report;

解决方案

Remove the line that is opening the viewer

CrystalReportViewer1.ViewerCore.ReportSource = report; 


Replace with a PrintToPrinter command e.g.

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


Other options ... Let me google that for you[^]


这篇关于如何打印水晶报表而不在c#windows应用程序中打开任何对话框。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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