Call Crystal Report from Visual Studio 2010
-
Thursday, October 21, 2010 3:51 AM
Hi, I am using VS2010. Now I want to create a simple Crystal Report and call that report from my desktop project (C#) VS2010. I have alredy download the Crystal Report for VS2010 installed in my Computer. I have create a crystal report (test.rpt) but could not call that report file.
when I run a error is thrown like:
"Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified."
my Sample code:
ReportDocument rep = new ReportDocument();
rep.Load(ReportPath);
rep.SetDataSource(reportDataSet);
this.crystalReportViewer1.ReportSource = rep;Plz, help about this issue.
-Arefin
Answers
-
Monday, October 25, 2010 4:03 AMModerator
Hi Arefin,
Welcome to MSDN forums!
Here is a link to down Crystal Report for Vs2010: http://www.businessobjects.com/jump/xi/crvs2010/default.asp
Please take the following steps to check your application:
1. Ensure the right ReportPath;
2. >> rep.SetDataSource(reportDataSet); //here you should set DataTable rather than dataset.
By the way, if the Crystal Report is not installed correctly, you should reinstall it.
Hope these helps, if you have any problems, please feel free to let me know.Best Regards,
Alan Chen
________________________________________
Please remember to mark the replies as answers if they help and unmark them if they provide no help- Marked As Answer by Alan_chenModerator Thursday, November 04, 2010 1:16 AM
All Replies
-
Monday, October 25, 2010 4:03 AMModerator
Hi Arefin,
Welcome to MSDN forums!
Here is a link to down Crystal Report for Vs2010: http://www.businessobjects.com/jump/xi/crvs2010/default.asp
Please take the following steps to check your application:
1. Ensure the right ReportPath;
2. >> rep.SetDataSource(reportDataSet); //here you should set DataTable rather than dataset.
By the way, if the Crystal Report is not installed correctly, you should reinstall it.
Hope these helps, if you have any problems, please feel free to let me know.Best Regards,
Alan Chen
________________________________________
Please remember to mark the replies as answers if they help and unmark them if they provide no help- Marked As Answer by Alan_chenModerator Thursday, November 04, 2010 1:16 AM
-
Tuesday, November 16, 2010 12:35 PM
Hi Arefin,
this is an error not because of a wrong installation of CR but because of Crystal Reports itself. They did not thought of how Microsoft .Net 4.0 loads assemblys. If the file is in its location and youre using ADO.NET for your reports you will encouter this error. It is in Cr 2010 beta es well as in the current production release.
You have to set BackWard-Compatibility with useLegacyV2RuntimeActivationPolicyThe Solution is, to set a flag in the app.config file of your project like this:
<
startup useLegacyV2RuntimeActivationPolicy="true">
<
supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
regards Roland
rs- Proposed As Answer by treepalm Saturday, March 19, 2011 10:21 PM
-
Saturday, March 19, 2011 10:22 PM
Thanks Roland, your solution worked for me.
Regards,
Nabeel