レポートがあり、それを印刷したいと考えています。現時点で私は使用しています:
myreport.PrintDialog()
Windows で [中止] をクリックするとPrintDialog
、レポートは標準のプリンターで印刷されます。このアボートをどのように処理できますか? OK に印刷したいだけですが、処理できませんDialogResult
。
レポートがあり、それを印刷したいと考えています。現時点で私は使用しています:
myreport.PrintDialog()
Windows で [中止] をクリックするとPrintDialog
、レポートは標準のプリンターで印刷されます。このアボートをどのように処理できますか? OK に印刷したいだけですが、処理できませんDialogResult
。
こんな仕事してんの?
PrintDialog dialog = new PrintDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
// do your printing process here
}
PrintTool.PrintDialog()
メソッドから;
プリンターの選択、いくつかの印刷オプションの設定、およびドキュメントの印刷に使用する印刷ダイアログ ボックスを実行します。
Return value
Type: Nullable<Boolean>
true if the user clicks OK in the dialog box; false if the user clicks Cancel;
using System;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
// ...
private void button1_Click(object sender, EventArgs e) {
// Create a report instance, assigned to a Print Tool.
ReportPrintTool pt = new ReportPrintTool(new XtraReport1());
// Invoke the Print dialog.
pt.PrintDialog();
// Send the report to the default printer.
pt.Print();
// Send the report to the specified printer.
pt.Print("myPrinter");
}