简体   繁体   English

执行Crystal Report时出错

[英]error while executing crystal report

I have created a crystal report to display my monthly sales details, so i created my report and data set SQL connection and all my code is working but when i give my 2 dates it is giving me a error that is: 我已经创建了一个水晶报表来显示我的每月销售明细,所以我创建了报表和数据集SQL连接,并且我所有的代码都正常工作,但是当我给出2个日期时,它给我一个错误,即:

"file notfound exception was unhandled " , "Could not load file or assembly 'file:///C:\\Program Files (x86)\\SAP BusinessObjects\\Crystal Reports for .NET Framework 4.0\\Common\\SAP BusinessObjects Enterprise XI 4.0\\win32_x86\\dotnet1\\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified." “未解决文件未找到异常”,“无法加载文件或程序集'file:/// C:\\ Program Files(x86)\\ SAP BusinessObjects \\ Crystal Reports for .NET Framework 4.0 \\ Common \\ SAP BusinessObjects Enterprise XI 4.0 \\ win32_x86 \\ dotnet1 \\ crdb_adoplus.dll”或其依赖项之一。系统找不到指定的文件。”

is this about referencing? 这是关于引用的吗?

try
{
   CRPinvDate rpt = new CRPinvDate();
   //my report.
   SqlConnection myConnection = default(SqlConnection);
   SqlCommand MyCommand = new SqlCommand();
   SqlDataAdapter myDA = new SqlDataAdapter();
   sDate_DS myDS = new sDate_DS();
   //my dataset

   myConnection = new SqlConnection(cs);
   MyCommand.Connection = myConnection;
   MyCommand.CommandText = "select *  from Invoice_Info where Invoice_Date between @Invoice_Date1 and @Invoice_Date2";
   MyCommand.Parameters.Add("@Invoice_Date1", SqlDbType.DateTime, 30, "Invoice_Date").Value = DateFrom.Value.Date;
   MyCommand.Parameters.Add("@Invoice_Date2", SqlDbType.DateTime, 30, "Invoice_Date").Value = DateTo.Value.Date;

   MyCommand.CommandType = CommandType.Text;
   myDA.SelectCommand = MyCommand;
   myDA.Fill(myDS, "Invoice_Info");
   rpt.SetDataSource(myDS);

   crystalReportViewer1.ReportSource = rpt;
}
catch (Exception ex)
{
   MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

uninstall Crystal Report Download Service pack 7 from http://scn.sap.com/docs/DOC-7824 http://scn.sap.com/docs/DOC-7824卸载Crystal Report下载Service Pack 7

this file http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_7.exe 此文件http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_7.exe

before installing crystal report install .net framework 3.5 & 4.0 install downloaded crystal report this will solve your problem 在安装Crystal Report之前,请安装.net Framework 3.5&4.0,然后安装下载的Crystal Report,这将解决您的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM