1
votes

I Created a New Crystal Report called Inv1 and a CrystalReportViewer1 Object on my Form, and this uses a Strongly Defined DataSet to show ALL Records in the TABLE which is Working Perfectly. However I am now trying to Restrict my Results to show only 1 Record based on the SQL SELECT Statement below. But I am receiving an Error on Runtime below from Crystal Reports.

ERROR RECEIVED ...


System.IO.FileNotFoundException was unhandled HResult=-2147024894 Message=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. Source=mscorlib FileName=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 FusionLog==== Pre-bind state information === LOG: Where-ref bind. Location = 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 LOG: Appbase = file:///C:/Users/rob/Documents/DEVELOPMENT/PMSLinx/PMSLinx/bin/Debug/ LOG: Initial PrivatePath = NULL

Calling assembly : (Unknown).

LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Users\rob\Documents\DEVELOPMENT\PMSLinx\PMSLinx\bin\Debug\PMSLinx.vshost.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Attempting download of new URL 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.

StackTrace: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.DataSetProcessingDelegate(IntPtr arg) InnerException:


CODE I AM CURRENTLY USING WITHIN ANOTHER FORM.

Dim objRpt As New Inv1 Dim invoiceDS As New DataSet

    Dim q As String = "select * from inv_data INNER JOIN res_data ON inv_data.inv_res_id = res_data.res_id WHERE inv_res_id = " & EditResID
    GetFromDB(invoiceDS, q)

    objRpt.SetDataSource(invoiceDS.Tables("table"))
    ViewReport.CrystalReportViewer1.ReportSource = objRpt
    ViewReport.CrystalReportViewer1.Refresh()
    ViewReport.Show()
1
I have Found a Solutions to this, and just wanted to POST this on here for anyone else having the same Problem. Looks like you have to modify the app.config in your Project with the below: try to add this to your .config file (usually app.config) Collapse | Copy Code < startup useLegacyV2RuntimeActivationPolicy="true"> < supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> < /startup>Rob4236

1 Answers

6
votes

try to add this to your .config file (usually app.config)

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