Symptom
- 実行時に設定されたプリンタが、Crystal Reports Viewer の印刷ボタンをクリックして表示される印刷ダイアログに送信されない
- ローカルマシンで通常使用するプリンタが常に選択される
Environment
- Crystal Reports XI
- Crystal Reports XI Release 2
- Crystal Reports 2008
- Microsoft Visual Studio .NET 2003
- Microsoft Visual Studio 2005
Reproducing the Issue
- レポートを表示する前に以下のコードを使用して、実行時のプリンタを設定します。
Visual Basic .NET サンプルコード:
crReportDocument.PrinterOptions.PrinterName = "プリンタ名"
- アプリケーションを実行して、Crystal Reports Viewer でレポートを表示します。
- ビューアで印刷ボタンをクリックします。
Cause
Resolution
回避方法: PrintToPrinter メソッドを使用して、レポートを出力してください。
CR XI 用 Visual Basic .NET のサンプルコード:
crReportDocument.PrinterOptions.PrinterName = "プリンタ名"
crReportDocument.PrintToPrinter(1, True, 1, 1)
CR 2008 用の C# のサンプルコード:
myRep.PrintOptions.PrinterName = "デフォルトプリンタ以外のプリンタ名""
System.Drawing.Printing.PageSettings mypage = new System.Drawing.Printing.PageSettings();
System.Drawing.Printing.PrinterSettings myprinter = new System.Drawing.Printing.PrinterSettings();
myprinter.PrinterName = myRep.PrintOptions.PrinterName;
myRep.PrintToPrinter(myprinter, mypage, False);
Keywords
CR for .NET, Crystal Reports, VS.NET, printer, dialog box, default, Crystal Reports for .NET, プリンタ, ダイアログボックス, デフォルト , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem