Crystal报表导出为PDF格式的问题 - 数据库登录失败 [英] Issue on Crystal report exporting to PDF format- Database logon failed
本文介绍了Crystal报表导出为PDF格式的问题 - 数据库登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友们,
我正在处理Crystal Report,
当我导出为PDF时它显示数据库登录失败错误。
我的代码是
Dear Frnds,
I am working on Crystal Report,
When I export to PDF its showing Database logon failed error.
My code is
string sPDFReportFile = "Payslip-" + _common.Utility.ToString(cmbMonth.Items[cmbMonth.SelectedIndex].Value) + Utility.ToString(cmbYear.Items[cmbYear.SelectedIndex].Value) + "-" + _common.Utility.ToString(Session.SessionID) + "." + Utility.ToString(filetype).Trim();
CrystalDecisions.Shared.DiskFileDestinationOptions dfdoReport = new CrystalDecisions.Shared.DiskFileDestinationOptions();
dfdoReport.DiskFileName = Request.PhysicalApplicationPath + @"TempReports\" + sPDFReportFile;
ReportDoc.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
if (filetype == "doc")
ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.RichText;
else if (filetype == "pdf")
ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
ReportDoc.ExportOptions.DestinationOptions = dfdoReport;
ReportDoc.Export();
ReportDoc.Close();
ReportDoc.Dispose();
return Utility.ToString(sPDFReportFile);
推荐答案
您需要在运行时应用登录详细信息。
C#Crystal Reports动态登录参数 [ ^ ]
You need to apply logon details at runtime.
C# Crystal Reports Dynamic Logon parameters[^]
看看这个问题 - 水晶报告错误数据库登录失败 [ ^ ]及其答案。
Have a look at this question - crystal report error Database Logon Failed[^] and its answers.
打开水晶报告并再次验证粘贴在服务器文件中......
Open crystal report and verify it again and paste in your server file...
这篇关于Crystal报表导出为PDF格式的问题 - 数据库登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文