Our environment:
Windows Server 2012 R2 Data-center Edition 64 bit
Visual Studio Pro 2013 Version 12.0.3.30110.00 Update 1
.Net 4.5.51641
Crystal Reports for VS 2013 V13.0.9.1312
Oracle ODAC 11.2.0
We created a winform application to generate a form letter report that runs fine within the IDE. When we build the the exe and copy it from the project folder to a folder on the C:\drive of this same pc and try to execute it we get these error messages (partial list);
CrystalDecisions.CrystalReports.Engine.DataSourceException: Failed to load database information.
Error in File temp_d55286fc-26ee-4216-9062-3e32380313ab {B640FD39-66AC-4B6E-995D-7218BB48A992}.rpt:
Failed to load database information. ---> System.Runtime.InteropServices.COMException: Failed to load database information.
Error in File temp_d55286fc-26ee-4216-9062-3e32380313ab {B640FD39-66AC-4B6E-995D-7218BB48A992}.rpt:
Failed to load database information.
at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)
at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)
at cr3Test.Form1.Form1_Load(Object sender, EventArgs e)
Here is the app:
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(sender As Object, e As EventArgs) Handles Me.Load
Dim crReportDocument As New CrystalReport3()
Dim DataSet1 As DataSet
Dim adoOleDbConnection As OleDbConnection
Dim adoOleDbDataAdapter As OleDbDataAdapter
Dim connectionString As String = ""
connectionString = "Provider=OraOLEDB.Oracle;"
connectionString += "Data Source=ourdb;"
connectionString += "User ID=ouruserid;Password=ourpsw"
adoOleDbConnection = New OleDbConnection(connectionString)
Dim sqlString As String = "select * from TEMP_FRI_LETTERS"
adoOleDbDataAdapter = New OleDbDataAdapter(sqlString, adoOleDbConnection)
DataSet1 = New DataSet()
adoOleDbDataAdapter.Fill(DataSet1, "TEMP_FRI_LETTERS")
'Dim xmlPath As String = "C:\Temp\test.xml" ' use these two statment s to verify dataset works
'DataSet1.WriteXml(xmlPath, XmlWriteMode.WriteSchema)
crReportDocument.SetDataSource(DataSet1)
crReportDocument.PrintOptions.PrinterName = "HP_LaserJet_4350_PCL_5e_Info_Tech"
crReportDocument.Refresh()
crReportDocument.PrintToPrinter(1, False, 0, 0)
DataSet1.Dispose()
adoOleDbDataAdapter.Dispose()
adoOleDbConnection.Close()
adoOleDbConnection.Dispose()
crReportDocument.Dispose()
Me.Close()
End Sub
End Class
Here is the app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.windows.forms jitDebugging="true" />
</configuration>
We have the CPU set to x86 as we are ultimately trying to generate a 32 bit app for XP and Win 7. We only installed the 32 bit run time on this pc because we have no intention of going to 64 bit apps on the clients. Are there additional dlls or something that has to be installed in the same folder as the exe on this development machine.
Bruce