Crystal报表无法与Access数据库连接

Crystal报表无法与Access数据库连接

本文介绍了Crystal报表无法与Access数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,当我将水晶报告与我的访问数据库连接时,突然出现问题时,我正在创建一个简单的水晶报告。错误如下所述。

Today, i was creating a simple crystal report when suddenly a problem arised as soon as i connected the crystal report with my access database. The error is mentioned below.

Error 1 Custom tool error: "Code generator 'ReportCodeGenerator' failed. Exception stack = CrystalDecisions.Shared.CrystalReportsException: Load report failed. ---> System.Runtime.InteropServices.COMException (0x800002AD): Error in File C:\Users\HARSHO~1\AppData\Local\Temp\ItemLedger {F2A0D055-4F7D-48F7-9990-AAC0E5938DCB}.rpt: The request could not be submitted for background processing. at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() --- End of inner exception stack trace --- at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) at CrystalDecisions.VSDesigner.CodeGen.ReportClassWriter..ctor(String filePath) at CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator.GenerateCode(String inputFileName, String inputFileContent)" D:\Software\My Code\New Project (Started Project)\Working On\Main Page 1\Forms\Printing\ItemLedger.rpt 1 1 Started Project



平台:Visual Studio 2008

水晶报表:Crystal Report 2008

访问权限:访问2013



谁能告诉我哪里出错?


Platform : Visual Studio 2008
Crystal Report : Crystal Report 2008
Access : Access 2013

Can anyone tell me where did i go wrong?

推荐答案

reportViewer1.Reset();// here you resting report
            reportViewer1.LocalReport.DataSources.Clear();
            ReportDataSource rpc = new ReportDataSource("DataSet1", dt);//here you can change the your source data ,im getting mine from dataset so you .. 
            reportViewer1.LocalReport.ReportPath = "charting.rdlc";//here is the code work with build on action with local reoport ..

            reportViewer1.LocalReport.DataSources.Add(rpc);
            reportViewer1.RefreshReport();
            reportViewer1.Visible = true;





plz if帮助您将其标记为已接受的解决方案..



plz if the helping you mark it as accepted solution ..


这篇关于Crystal报表无法与Access数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 07:53