问题描述
我在PrintDocument中有数据(报告),如何在.Pdf中保存/导出它?
我想保存并邮寄报告,我有邮件应用程序,但是我可以保存位于PrintDocument/PrintPreviewControl中的数据(报告).因此,请告诉我将数据从PrintDocumnet/PrintPreviewControl导出到.pdf/.Word/.Xls ....
I have Data(Report) in PrintDocument, How can i Save/Export it in .Pdf ?
I want to save And Mail my Report, I have Mail Application, But i Could Save my Data(Report) Which is in PrintDocument/PrintPreviewControl. So, Please tell me the way by which i can Export data from PrintDocumnet/PrintPreviewControl to .pdf/.Word/.Xls....
推荐答案
reportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "C:\Files\Report.pdf");
检查ExportFormatType的其他选项
希望对您有所帮助:)
Check for other option of ExportFormatType
Hope this will help :)
ReportDocument.PrintOptions
我不认为使用ReportDocument而不是PrintDocument会很困难.这是基本代码
I dont think it will be difficult to use ReportDocument instead of PrintDocument. Here''s a basic code
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(< YOur report file name/path >);
reportDocument.SetDataSource( );
reportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "C:\Files\Report.pdf");
reportDocument.Close();
reportDocument.Dispose();
这篇关于有关PrintDocument或PrintPreviewControl的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!