Crystal Reportsを使用して帳票印刷時、プリンタのキューに表示されるドキュメント名(タイトル)を指定する方法です。
VS2010に付属のCrystal Reportsでは、SummaryInfoプロパティが持っているReportTitleに値をセットすれば設定可能です。
// 帳票のタイトルをセット cryReport.SummaryInfo.ReportTitle = "ピッキングリスト"; // プリンタに印刷 cryReport.PrintToPrinter( 0, false, 0, 0 ); |
実際に印刷してみたときのキュー表示は以下の通りです。
ドキュメント名の頭に”Crystal Reports – “の接頭語は必ずついてしまう様です。
これを削除する方法は分かりませんでした…
ちなみに、VS2005,VS2008付属のCrystal Reportsは、異なる設定方法だそうです。
手元に環境が無いので、動作の確認はしていません
VB.Netのサンプル
Dim crReportDocument As New ReportDocument Dim boReportClientDocument As ISCDReportClientDocument Dim boPrintOutputController As PrintOutputController Dim boPrintReportOptions As New PrintReportOptions ' load the report boReportClientDocument = crReportDocument.ReportClientDocument boPrintOutputController = boReportClientDocument.PrintOutputController ' set print job title boPrintReportOptions.JobTitle = "ピッキングリスト" ' print the report boPrintOutputController.PrintReport(boPrintReportOptions) |
参考資料:
Print job name issue SCN
SAP Note 1386475 – How to set printer name and print job title at runtime using Report Application Server SDK for Visual Studio .NET
Visual C#2008逆引き大全至高の技 データベース+印刷/帳票編
関連記事
コメントを残す