首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >水晶重复和错误数据库供应商代码: 17

水晶重复和错误数据库供应商代码: 17
EN

Stack Overflow用户
提问于 2017-06-20 15:53:46
回答 1查看 592关注 0票数 1

我在Windows 10上运行报告时遇到问题。

我的代码:

代码语言:javascript
复制
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[]参数):

EN

Stack Overflow用户

发布于 2017-10-17 18:39:18

wait answear::数据库供应商代码: 17无法打开连接。temp_51c8028b-63ae-4583-b67e-432994f29f554132_3340

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44647057

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档