我想打印我的Crystal Report而不转换为.pdf。当用户点击打印按钮时,只需打开浏览器的打印视图。
答案 0 :(得分:0)
尝试将此代码直接导出到.pdf文件中.......
ExportOptions CrExportOptions ;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net-informations.pdf";
CrExportOptions = doc.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
doc.Export();
而不是c:\\csharp.net-informations.pdf
设置您要保存pdf文件的路径