C# 如何将“打印”对话框置于前端?
我有一个打印按钮,可以直接将Crystal报表打印到打印机上。我的代码如下:C# 如何将“打印”对话框置于前端?,c#,asp.net,crystal-reports,C#,Asp.net,Crystal Reports,我有一个打印按钮,可以直接将Crystal报表打印到打印机上。我的代码如下: CrystalDecisions.CrystalReports.Engine.ReportClass clsReport = new CrystalDecisions.CrystalReports.Engine.ReportClass(); protected void Button3_Click(object sender, EventArgs e) { System.Windows.Forms.Print
CrystalDecisions.CrystalReports.Engine.ReportClass clsReport = new CrystalDecisions.CrystalReports.Engine.ReportClass();
protected void Button3_Click(object sender, EventArgs e)
{
System.Windows.Forms.PrintDialog dialog1 = new System.Windows.Forms.PrintDialog();
dialog1.AllowSomePages = true;
dialog1.AllowPrintToFile = false;
if (dialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
int copies = dialog1.PrinterSettings.Copies;
int fromPage = dialog1.PrinterSettings.FromPage;
int toPage = dialog1.PrinterSettings.ToPage;
bool collate = dialog1.PrinterSettings.Collate;
clsReport.PrintOptions.PrinterName = dialog1.PrinterSettings.PrinterName;
clsReport.PrintToPrinter(copies, collate, fromPage, toPage);
}
}
这很好,但我的问题是,每当我点击打印按钮时,打印拨号会出现在所有页面的后面,因此有时我甚至看不到它是否出现。所以,我想把打印对话框放在所有窗口的前面
谢谢。不要在ASP.NET中使用
WinForm
组件--它们在远程客户端上无法工作。那么我可以使用什么..您能提出建议吗?当然,使用crystal reporting ASP.NET控件--您可以声明性地添加它们或动态创建它们。