cystalreport转换为pdf [英] cystalreport convert to pdf
本文介绍了cystalreport转换为pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,来自土耳其.如何使用C#将水晶报表另存为pdf,用于桌面应用程序.但是水晶报表已连接到数据集对象,因此我的代码无法运行,我的代码是:
Hi from Turkey. How to crystal report save as pdf using c# for desktop application. But the crystal report is connected a dataset object so my code is not run my code is:
ReportDocument myReport = new ReportDocument();
Crystal MyCrystalReport= new Crystal();
MyCrystalReport.SetDataSource(_Dt_procesplain);
myReport.ReportSource= MyCrystalReport;
filename = filename + "." + ExpType;
//creating new instance representing disk file destination options such as filename, export type etc.
DiskFileDestinationOptions crDiskFileDestinationOptions = new DiskFileDestinationOptions();
ExportOptions crExportOptions = crReportDocument.ExportOptions;
crDiskFileDestinationOptions.DiskFileName = ExportPath + filename;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
从答案中移出
错误消息缺少值,异常消息为CrystalDecisions.ReportAppServer.ConvertDotNetToErom
Moved from Answer
the error message is missing value and exception message is CrystalDecisions.ReportAppServer.ConvertDotNetToErom
推荐答案
如果您需要帮助,我可能已经解决了此问题,请与我联系
Probably i solved this problem if you need a help, contact to me
Show CrystalReport()
{
MyReportPriview rOnizle = new MyReportPriview();//Windows Form
Raporlar.ProsesPlani ReportRprosesPlani = new winTMO.Raporlar.ReportProsesPlani();
rOnizle.RaporKaynagi = ReportprosesPlani;
RprosesPlani.SetDataSource(_DataTableProsesPlani);
}
//I create a crystal report at top
/////My report need a dataset so it have to once show so it can copy dateset to report after We can save it as pdf on formClosed
private void MyReportPriview_FormClosed(object sender, FormClosedEventArgs e)//That is a windowsForm for crystal reportViewer;
{
filename = filename + "." + ExpType;
//creating new instance representing disk file destination options such as filename, export type etc.
DiskFileDestinationOptions crDiskFileDestinationOptions = new DiskFileDestinationOptions();
ExportOptions crExportOptions = crReportDocument.ExportOptions;
crDiskFileDestinationOptions.DiskFileName = ExportPath + filename;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
}
不幸的是,我的英语不好,我希望你能理解我:))))
Unfortunatelly my english is bad i hope that you understand me :)))
这篇关于cystalreport转换为pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文