有关PrintDocument或PrintPreviewControl的帮助 [英] Help with PrintDocument or PrintPreviewControl

查看:106
本文介绍了有关PrintDocument或PrintPreviewControl的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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的方式的PrintDocument.

Use ReportDocument instead of PrintDocument.

reportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "C:\Files\Report.pdf");



检查ExportFormatType的其他选项

希望对您有所帮助:)



Check for other option of ExportFormatType

Hope this will help :)


感谢回复,

但是,我已经使用PrintDocumnet了很多次,并且我有很多使用PrintPreviewControl在PrintDocument上运行的项目...

如何将所有PrintDocument的编码转换为ReportDocument?
"coz PrintDocument的代码和ReportDocumnet的代码太不同了....

在ReportDocumnet中,我无法分配PaperSize,Paper Margin等.

pdf还有其他方法吗?
Thanx For Reply,

But, I have use PrintDocumnet So Many times and i have Many Project thats work on PrintDocument With PrintPreviewControl...

How can i convert my All PrintDocument''s Coding To ReportDocument?
''coz PrintDocument''s Codes and ReportDocumnet''s Codes are too different....

In ReportDocumnet i could not assign PaperSize, Paper Margin,.Etc...

Is There Any Other Way for pdf??


我认为PrintDocument不会有所帮助. PrintDocument的唯一选项是使用"PDF xChange"作为打印"对话框上的打印机,这会将报告另存为PDF.

关于ReportDocument ...您可以在
中设置打印参数,例如PaperSize,Margins等.
I dont think PrintDocument will help. The only option with PrintDocument is use ''PDF xChange'' as a printer on Print Dialog which will save the report as PDF.

About the ReportDocument... You can set the printing parameters like PaperSize, Margins etc in
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的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆