打印Crystal Report而不转换为asp.net中的pdf

时间:2013-05-07 08:07:20

标签: asp.net crystal-reports

我想打印我的Crystal Report而不转换为.pdf。当用户点击打印按钮时,只需打开浏览器的打印视图。

1 个答案:

答案 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文件的路径