C#Crystal Reports-导出DLL(导出pdf)检测到错误

时间:2019-03-14 09:16:43

标签: c# crystal-reports

使用Crystal报表我正在导出大量报告(超过1000个),并导出为pdf。 当我的应用程序在具有数据库A的服务器上运行时,没有问题,但是当我在具有数据库B的另一台服务器(Windows Server 2012 r2)上运行我的应用程序时,异常CrystalDecisins.CrystalReports.Engine.ExportException:文件[tempFileName]中的错误。 rpt:导出DLL检测到错误。

我试图制作一个报告,并将其导出为pdf,仅包含异常但没有问题的数据。

数据库的loginfo就是这样的:

report = new ReportDocument();
report.Load(path);
foreach (Table table in report.Database.Tables)
{
   table.LogOnInfo.ConnectionInfo = ciReportConnection;
   table.ApplyLogOnInfo(table.LogOnInfo);
}

foreach (ReportDocument subrep in report.Subreports)
{
   foreach (Table table in subrep.Database.Tables)
   {
      table.LogOnInfo.ConnectionInfo = ciReportConnection;
      table.ApplyLogOnInfo(table.LogOnInfo);
   }
}

我这样导出报告:

ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = pathSEND + $"ADD_DEV_{timeStamp}.pdf";
pathSEND += $"ADD_DEV_{timeStamp}.pdf";
CrExportOptions = report.ExportOptions;
{
   CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
   CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
   CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
   CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
report.Export();

最后我处理报告:

report.Close();
report.Dispose();
report = null;

服务器上安装了用于.Net Framework(64位)版本13.0.16.1954的SAP Crystal Reports运行时引擎。

在堆栈跟踪中,异常位于CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions,RequestContext pRequestContext)

报告中有3张图像不是来自数据库,而是直接放在报告中。 所有文本使用的字体均为arial。

任何想法如何处理此错误?

0 个答案:

没有答案
相关问题