3
votes

I am using CrytalReports for Visual Studio 10 (.NET 4) for WPF. Whenever I load the Window with the CrystalReportViewer, it says,

Could not load file or assembly 'file:///C:\Program Files\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.

I have added all the dll files/assemblies as references to the project.

Project References

Please suggest me what to do, I am really reaching my deadlines. Thanks in advance.

conn obj = new conn();
            SqlConnection con = new SqlConnection(obj.get_connection());

            SqlDataAdapter sda = new SqlDataAdapter("select * from fee_window where dateofdeposite='" + DateTime.Now.ToString("MM/dd/yyyy") + "'", con);
            DataSet_daybook ds = new DataSet_daybook();

            sda.Fill(ds, "fee_window");

            ReportDocument report = new ReportDocument();
            report.Load(@"..\..\Report_daybook.rpt");
            report.SetDataSource(ds);
            crystalReportsViewer1.ViewerCore.ReportSource = report;

Added My code.

2

2 Answers

7
votes

add the following attribute to your app.config startup element

<startup useLegacyV2RuntimeActivationPolicy="true">

</startup>
1
votes

see this discussion.
http://scn.sap.com/thread/1665437
i hope this discussion will help you.