Crystal reports error in SetDataSource

家住魔仙堡 提交于 2019-12-21 09:17:14

问题


I am having trouble in VS 2010 sap crystalreports, using c# to make a windows application.

I get the following error with the following code:

 CrystalReport1 cr1 = new CrystalReport1();
 cr1.SetDataSource(dt1); //Error 
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\win64_x64\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.

回答1:


Try using this solution by adding the useLegacyV2RuntimeActivationPolicy attribute to your .config file

<startup useLegacyV2RuntimeActivationPolicy="true">



回答2:


 <startup useLegacyV2RuntimeActivationPolicy="true" >
    <supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0" />
 </startup>

Add this code in app.config.




回答3:


You probably need to install the crystal reports runtime files. You should be able to do a google search to find them. The error message is pretty explicit in telling you the problem is a missing .dll. Read it ;)

edit: Try locating the crdb_adoplus.dll on your machine and copying it to the application directory.



来源:https://stackoverflow.com/questions/10940940/crystal-reports-error-in-setdatasource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!