We have VS 2008 (V9.0.30729.1 SP1) using .Net 3.5 under Windows Server 2003 R2 Data Center Edition. VS 2008 came with Crystal Reports Version 10.5.3700.0. We developed a little report in a winform to run against Oracle 11gR2 using the OLE DB support in the CR Report Wizard in the VS 2008 IDE. It was a standard report with some code to print the report directly to the printer with out the viewer control. Here is the working code:
Imports System.Data.OleDb
Imports System.Data
Imports System
Imports System.Windows.Forms
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim crReportDocument As New CrystalReport1()
Dim DataSet1 As DataSet
Dim adoOleDbConnection As OleDbConnection
Dim adoOleDbDataAdapter As OleDbDataAdapter
Dim connectionString As String = ""
connectionString = "Provider=OraOLEDB.Oracle;"
connectionString += "Data Source=OURDBNAME;"
connectionString += "User ID=OURUSERID;Password=OURPSW"
adoOleDbConnection = New OleDbConnection(connectionString)
Dim sqlString As String = ""
sqlString = "SELECT * FROM edi_filing_source_lov where filing_source_code in ('A','E')"
adoOleDbDataAdapter = New OleDbDataAdapter(sqlString, adoOleDbConnection)
DataSet1 = New DataSet()
adoOleDbDataAdapter.Fill(DataSet1, "edi_filing_source_lov")
crReportDocument.Database.Tables(0).SetDataSource(DataSet1)
crReportDocument.PrintOptions.PrinterName = "HP_LaserJet_4350_PCL_5e_Info_Tech"
crReportDocument.Refresh()
crReportDocument.PrintToPrinter(1, False, 1, 99)
Me.Close()
End Sub
End Class
We want to migrate this report to VS 2013. We installed VS 2013 Professional (V12.0.30110.00 Update 1) under Windows Server 2012 R2 Data Center Edition. We downloaded CRforVS_13_0_9 and installed it in VS 2013. We moved the project from VS 2008 and opened it under VS 2013. It looks like it converted OK. When we run it we get the following error:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll
Additional information: Failed to load database information.
Error in File temp_f11eb1be-db98-4d33-800c-4db3b36ab14e {EEB2A9E4-8239-49CB-B016-8CE4F4C7643E}.rpt:
Failed to load database information.
More information: We can step through the wizard in VS 2013 using the standard template and add a report viewer control to the form and point it at the report and run it just fine in the VS 2013 IDE when there is no code in the form1_load event. We feel we have the Oracle.DataAccess.dll for the 11.2.0 client installed and tested correctly on the server and do not feel there is an issue with data base installation. When we add back the code above to the form1_load event and run it we get the error above.
We have the logger set up but nothing gets added to the log files.
We have tried three different ways to set the data source to resolve the error that is occurring at this line of code that is failing but with no luck:
crReportDocument.Database.Tables(0).SetDataSource(DataSet1)
crReportDocument.SetDataSource(DataSet1)
crReportDocument.Database.Tables(0).SetDataSource(DataSet.Tables("edi_filing_source_lov"))
Do you have any other suggestions we could try?
Bruce
Request clarification before answering.
Hi Bruce,
Should be no reason it should fail... I have to get my Oracle Client working again then test it...
Update you tomorrow...
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Don,
We are continuing to try to identify the problem. Ran Process Monitor but there is so much stuff in there we do not know what to look for. We can write the data set to XML, so that part works:
Dim xmlPath As String = "C:\Temp\test.xml"
DataSet1.WriteXml(xmlPath, XmlWriteMode.WriteSchema)
We only installed the 32 bit run time on this 64 bit server as we want to deploy to Windows 7 32 bit clients eventually. On the compile options we have set the Target CPU to x86 so we are assuming this should run OK.
Can you think of any thing else we can try?
Thanks.
Bruce
Hi Bruce
In my experience, the only reason for the error is that the there is an issue with the dataset and as a back up sort of a thing, the report engine is attempting to connect to the database the report was created off of. To test the dataset with the report, see this wiki on how to.
Also, ensure that you have a look at this KBA.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Hi guys,
We did a lot of reading from the wiki and the KBA and we found by trial and error that this change below added to the app.config works but the KBA really doesn't say why:
<startup useLegacyV2RuntimeActivationPolicy="true">
We also replaced the app.config from VS 2008 with the VS 2013 one as the 2008 config seemed to have extra stuff in it that did not appear to be needed.
We will now continue to exercise CR for VS 2013.
Thanks.
Bruce
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.