我在Windows 10上运行报告时遇到问题。
我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions;//.Windows.Forms;
using System.Drawing;
using CrystalDecisions.CrystalReports;
[STAThread]
static void Main(string[] args)
{
try
{
System.Threading.Thread.CurrentThread.SetApartmentState(System.Threading.ApartmentState.STA);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
ReportDocument report;
try
{
int id = Int32.Parse(args[0]);
report = new ReportDocument();
report.Load(ConfigurationService.GetConfig().Localistaion);
report.SetDatabaseLogon(ConfigurationService.GetConfig().User, ConfigurationService.GetConfig().Password, ConfigurationService.GetConfig().ServerName, ConfigurationService.GetConfig().Database);
report.SetParameterValue("pInvoiceHeader_Id", id);
report.PrintToPrinter(2, false, 1, 5);
Console.ReadKey();
}
catch (Exception ex) { Console.WriteLine("{0}: ", ex.ToString()); Console.ReadKey(); }
}无法打开发票:发票6172_11120_{DE173B3A-EEC6-41EF-937D-75576F6BEDCA}.rpt无法打开连接。e: 17 ]-> connection.s.Engine.InternalException:发票供应商详细信息:数据库供应商代码: 17 ) at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext) -内部异常堆栈跟踪结束-在CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)在CrystalDecisions.ReportSource.EromReportSourceBase.HandleException(Exception exception)在CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)在CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies,Boolean collated,Int32 startPageN,Int32 endPageN) at CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies,Boolean collated,Int32 startPageN,Int32 endPageN) at Prnt2.Program.Main(String[]参数):
发布于 2017-10-17 18:39:18
wait answear::数据库供应商代码: 17无法打开连接。temp_51c8028b-63ae-4583-b67e-432994f29f554132_3340
https://stackoverflow.com/questions/44647057
复制相似问题