【问题标题】:Crystal Server .NET integration Enterprise ReportDocument.Load ExceptionCrystal Server .NET 集成企业 ReportDocument.Load 异常
【发布时间】:2012-11-02 10:49:11
【问题描述】:

我正在使用 Visual Studio 2010,并安装了与 SAP Crystal Server 2011 通信所需的各种插件。一切正常,我可以毫无问题地查询数据(例如返回文件夹中的文件夹列表)。

我正在尝试将此与 CrystalReportViewer 组件集成,该组件似乎正在工作,直到我尝试将返回的 InfoObject 加载到 ReportDocument.Load 中。它总是返回:

未知错误 0x80040200。

任何想法将不胜感激。我有点不知所措。关于如何做到这一点的其他建议,我也会采纳。

只是为了澄清。登录工作正常,InfoObject 有效(Response.Write 返回报告的正确 ID 和标题)。

SessionMgr ceSessionMgr = new SessionMgr();
EnterpriseSession ceSession = ceSessionMgr.Logon(ConfigurationManager.AppSettings["CrystalUser"].ToString(), ConfigurationManager.AppSettings["CrystalPassword"].ToString(), ConfigurationManager.AppSettings["CrystalServer"].ToString(), "Enterprise");
EnterpriseService ceEnterpriseService = ceSession.GetService("", "InfoStore");
InfoStore ceInfoStore = new InfoStore(ceEnterpriseService);

PluginManager cePluginMgr = ceInfoStore.PluginManager;
PluginInfo ceReportPlugin = cePluginMgr.GetPlugins("Desktop")["CrystalEnterprise.Report"];

InfoObjects ceInfoObjects = ceInfoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' AND SI_ID=" + Convert.ToInt32(Request["ReportID"]));

InfoObject ceInfoObject = ceInfoObjects[1];

Response.Write(ceInfoObject.ID.ToString() + " = " + ceInfoObject.Title + "<br/>");

CrystalDecisions.CrystalReports.Engine.ReportDocument ceReportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ceReportDocument.Load(ceInfoObject, ceSession);

CrystalReportViewer1.Visible = true;
CrystalReportViewer1.EnterpriseLogon = ceSession;
CrystalReportViewer1.ReportSource = ceReportDocument;

【问题讨论】:

    标签: .net visual-studio-2010 c#-4.0 crystal-reports-server


    【解决方案1】:

    不得不改用 RAS 服务器来解决这个问题。不知道为什么上述方法不起作用,因为根据 Docs 它应该。

    // View the report using page server
    PSReportFactory yPSReportFactory = (PSReportFactory)ceSession.GetService("PSReportFactory").Interface;
    myReportSource = myPSReportFactory.OpenReportSource(ReportID);
    //place the report source in session for use with postbacks
    Session.Add("ReportSource", myReportSource);
    
    CrystalReportViewer1.EnterpriseLogon = ceSession;
    CrystalReportViewer1.ReportSource = myReportSource;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-18
      • 2013-11-12
      • 2011-02-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多