on 08-31-2012 3:14 AM
Hi,
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.
Interop.CRAXDDRT.dll
Interop.CRAXDRT.dll
AxInterop.CrystalActiveXReportViewerLib11.dll
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
CrystalDecisions.CrystalReports. Engine
CrystalDecisions.CrystalReports. Design
CrystalDecisions.ReportSource
CrystalDecisions.Shared
CrystalDecisions.Windows.Form
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
End If
End If
'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
currValue.Add(paraValue)
objReport.DataDefinition.ParameterFields(strVal(0)).ApplyCurrentValues(currValue)
End If
Next
End If
ConInfo.ConnectionInfo.ServerName = "ELTTMSQBES01"
ConInfo.ConnectionInfo.DatabaseName = "absolution_prod"
For intCounter = 0 To objReport.Database.Tables.Count - 1
objReport.Database.Tables(intCounter).ApplyLogOnInfo(ConInfo)
Next
' 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
With objReport.ReportDefinition.Sections(index)
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
mySubRepDoc.Database.Tables(intCounter1).ApplyLogOnInfo(ConInfo)
mySubRepDoc.Database.Tables(intCounter1).ApplyLogOnInfo(ConInfo)
Next
End If
End With
Next
Next
'Re setting control
CRViewer1.ReportSource = Nothing
'Set the current report object to report.
CRViewer1.ReportSource = objReport
'Show the report
CRViewer1.Show()
End Sub
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....
Hi,
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"
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
http://scn.sap.com/docs/DOC-7824
- Ludek
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.