VS2010中的Crystel报告错误 [英] Crystel Report Error in VS2010
本文介绍了VS2010中的Crystel报告错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当尝试显示Crystal Report错误时:
无法加载文件或程序集'file:/// C:\Program Files \SAP BusinessObjects \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\系统找不到指定的文件。
Show CrystelReport的代码:
Dim rptInvoiceDt As New DataTable
PrintReporObj = New DataAccessLayer
rptInvoiceDt = PrintReporObj.Filldatatable(SELECT * FROM InvoiceReport WHERE JobListID =& JobAndTrackingMDI.GetJobID&)
如果rptInvoiceDt.Rows.Count = 0则
KryptonMessageBox.Show(未找到记录)
Else
Dim Rpt As New ReportDocument
Dim ReportPath As String = Application.StartupPath& \ Reportport; \\ rptInvoice.rpt
Rpt.Load(ReportPath)
Rpt.SetDataSource(rptInvoiceDt)'< - 当此行执行时发生错误 - >
CRVInvoice.ReportSource = Rpt
结束如果
解决方案
在这里你找到解决的链接
无法在VS 2010和CR中加载文件或程序集错误 [ ^ ]
Crystal Reports 2010 Beta 2 for Visual Studio运行时错误 [ ^ ]
尝试将以下部分添加到配置文件中,它应该可以解决问题。
< startup uselegacyv2runtimeactivationpolicy = true >
< supportedruntime version = v4.0 / >
< / startup >
更改此部分:
< pre lang =HTML>< star tup>< supportedruntime version =v4.0sku =。NETFramework,Version = v4.0>
< startup > useLegacyV2RuntimeActivationPolicy =true> < supportedruntime version = v4.0 sku = 。NETFramework,Version = v4.0 / > < / startup >
When try to show Crystal Report error comes:
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.
Code for Show CrystelReport:
Dim rptInvoiceDt As New DataTable PrintReporObj = New DataAccessLayer rptInvoiceDt = PrintReporObj.Filldatatable("SELECT * FROM InvoiceReport WHERE JobListID=" & JobAndTrackingMDI.GetJobID & "") If rptInvoiceDt.Rows.Count = 0 Then KryptonMessageBox.Show("Record Not found") Else Dim Rpt As New ReportDocument Dim ReportPath As String = Application.StartupPath & "\Reports\rptInvoice.rpt" Rpt.Load(ReportPath) Rpt.SetDataSource(rptInvoiceDt) '<--When This Line execute the error occur --> CRVInvoice.ReportSource = Rpt End If解决方案Here you go for solved links
Could not load file or assembly error in VS 2010 and CR[^]
Crystal Reports 2010 Beta 2 for Visual Studio Runtime Error[^]
Try adding the following section to your config file and it should resolve the issue.
<startup uselegacyv2runtimeactivationpolicy="true"> <supportedruntime version="v4.0" /> </startup>
in your application config file change this section:
<pre lang="HTML"><startup><supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0">
to
<startup>useLegacyV2RuntimeActivationPolicy="true"><supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup>
这篇关于VS2010中的Crystel报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文