We were using VB.NET 2010 and CR 11.5 in our current PC and it works fine. We create reports in CR 11.5 and call it in VB.NET 2010. It worked fine so far in our PC and in Users PC.
We were asked to test the application in Windows 7 and the CR failed. I read lot of forums and it said that the following DLL's does not work in Windows 7 with VB.NET 2010.
So we got CR for .NET 2010 and create a small project with just 1 screen that calls the CR that was created in 11.5, but the viewer we used in the project is from the CR for .NET 2010. I included the following reference in the Project
When I created a setup package to install in Windows 7.0, it did not put any Crystal reports DLL in the setup package. After installation, the project did not work and it gave me error. Also the Runtime files for CR for .NET is installed in Windows 7 before the Project was installed.
HEre is the code:
Public Sub OpenCrystalReport(ByRef ReportName As String, ByRef ReportPath As String, ByVal param As String)
Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo
Dim paraValue As New CrystalDecisions.Shared.ParameterDiscreteValue
Dim currValue As CrystalDecisions.Shared.ParameterValues
Dim mySubReportObject As CrystalDecisions.CrystalReports.Engine.SubreportObject
Dim mySubRepDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim intCounter As Integer
Dim index As Integer
Dim strParValPair() As String
Dim strVal() As String
objReport.Load(ReportPath & ReportName)
intCounter = objReport.DataDefinition.ParameterFields.Count
'As parameter fields collection also picks the selection formula which is not the parameter
'so if total parameter count is 1 then we check whether its a parameter or selection formula.
If intCounter = 1 Then
If InStr(objReport.DataDefinition.ParameterFields(0).ParameterFieldName, ".", CompareMethod.Text) > 0 Then
intCounter = 0
'apply parameters to the report
If intCounter > 0 And Trim(param) <> "" Then
strParValPair = param.Split("&")
For index = 0 To UBound(strParValPair)
If InStr(strParValPair(index), "=") > 0 Then
strVal = strParValPair(index).Split("=")
paraValue.Value = strVal(1)
currValue = objReport.DataDefinition.ParameterFields(strVal(0)).CurrentValues
ConInfo.ConnectionInfo.ServerName = "ELTTMSQBES01"
ConInfo.ConnectionInfo.DatabaseName = "absolution_prod"
For intCounter = 0 To objReport.Database.Tables.Count - 1
' Loop through each section on the report then look through each object in the section
' if the object is a subreport, then apply logon info on each table of that sub report
For index = 0 To objReport.ReportDefinition.Sections.Count - 1
For intCounter = 0 To objReport.ReportDefinition.Sections(index).ReportObjects.Count - 1
If .ReportObjects(intCounter).Kind = CrystalDecisions.Shared.ReportObjectKind.SubreportObject Then
mySubReportObject = CType(.ReportObjects(intCounter), CrystalDecisions.CrystalReports.Engine.SubreportObject)
mySubRepDoc = mySubReportObject.OpenSubreport(mySubReportObject.SubreportName)
For intCounter1 = 0 To mySubRepDoc.Database.Tables.Count - 1
'Re setting control
CRViewer1.ReportSource = Nothing
'Set the current report object to report.
CRViewer1.ReportSource = objReport
'Show the report
The error is
The error is: Could not load file or assembly "CrystalDecisions.Windows.Forms, Version 13.0.2000.0, culture = neutral, PublicKeyToken=692fbea5521e1304" or one of it components. The system cannot find the files specified.
Am I suppossed to include any files in the setup project?? Am I missing something?? Please help. I am unable to proceed in Windows 7 now....
Error msg is look's like as crystal report runtime varsion have some issue "CrystalDecisions.Windows.Forms, Version 13.0.2000.0" is it correct dll. please make sure that, and also make sure that if u'r appliction in runing on "32 bit then u required 32 bit runtime(CRRuntime_32bit_13_0_4.msi)" or "if it's 64 bit then it's required 64bit runtime(CRRuntime_64bit_13_0_4.msi)"
you can see the correct dll varsion of runtime at this location .> "C:\Windows\assembly"
Nitesh is correct. You are missing the CR runtime. E.g.; you can not deploy the runtime without using either the merge modules or MSI file. This link will get you to the downloads:
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
Thanks Nithesh and Ludek.
I installed the runtime engine and now able to see the correct version of the DLLS under c:\windows\assembly\ folder.
Now the application gives different error.
The error is: Method not found: "Void CrystalDecisions.Windows.Forms,CrystalReportViewer.set_showCopyButton(Boolean)".
Am I doing somehting wrong in my code??