cancel
Showing results for 
Search instead for 
Did you mean: 

CR Failed to load database information cr v13.0.32

lawrence_sall
Explorer
0 Kudos
154

I've built a new project using CR for VS sp 32. this is a COM DLL for use through VBA. On any dev box I have, VS2015, vs2017, vs2019, vs2022 the DLL runs perfectly fine. I'm using Entity Framework 6.0 along with .net framework 4.6.1. I've built several desktop apps using CR for VS without issues. On any dev box this DLL runs perfect.

The fail point is when I ask for a preview of the report. or when I send the report to the printer directly. Since the DLL runs on dev box I have no way to debug step by step. I know the data is there as I show it in the form i present to user.here is the source I use to build the reportdocument:

    private ReportDocument GetReportDoc(string packSlipId)
{
using (var ctx = new TSGPackData(_CnnStr))
{
List<PackSlipDataView> lst = (from psd in ctx.PackSlipDatasView where psd.PD_ID == packSlipId select psd).ToList();
_crRptDoc.SetDataSource(lst);
_crRptDoc.SummaryInfo.ReportTitle = "Pack Slip Reprint " + packSlipId;
_crRptDoc.PrintOptions.PrinterName = _printrName;
_crRptDoc.PrintOptions.PrinterDuplex = PrinterDuplex.Simplex;
return _crRptDoc;
} //using (var ctx = new TSGPackData(_CnnStr))
}


based on the error message it seems to be failing on the _crrptdoc.setdatasource. I've gone as far as to build a VM with Windows 10 64bit, ensured that I only have installed SQL Server Management Console,

Notepad++, VBA and it's project, the COM Dll I built and CR runtime 32bit. and there is no error it

runs as expected. The RPT file has been used for over 2 years and is still being used by the

older application even now. No the Report is not embedded in the app by design. the app in this case is a class with a COM interop interface.Here is the error at customer site:

************** Exception Text **************

CrystalDecisions.CrystalReports.Engine.DataSourceException: Error in File PackSlip 8236_1216_{07CB423E-E08D-4767-A96E-690C18D855AD}.rpt:

Failed to load database information. ---> System.Runtime.InteropServices.COMException: Error in File PackSlip 8236_1216_{07CB423E-E08D-4767-A96E-690C18D855AD}.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(IEnumerable enumerable)

at TSGReportMgr2022.Forms.PackSlipReview.GetReportDoc(String packSlipId)

at TSGReportMgr2022.Forms.PackSlipReview.BtnPreview_Click(Object sender, EventArgs e)

at System.Windows.Forms.Control.OnClick(EventArgs e)


Any ideas please!?!

Accepted Solutions (1)

Accepted Solutions (1)

lawrence_sall
Explorer
0 Kudos

Found the issue, I just missed it...

OK per the docs SP prior to sp21 must be uninstalled first. I had sp05 installed on customer site. Which is why I could not repeat it on my systems. The runtime installer did recognize the previous install and said it would overwrite, but as per the docs it did not do it correctly.

Uninstall any version or CR prior to sp22 first then install newer...

Answers (1)

Answers (1)

0 Kudos

Hi Lawrence,

It could one of two things....

What database client are you using? Possibly your app can't find the Client.

Try a report with no database in it, comment out the code to log on, just a text box with "Hello World" in it.

Then uncomment the log on to database code and see what happens, just use the log on part..

the second issue is CR has never supported what's called a "double hop", COM to Framework to COM or COM to COM, it's a COM layering issues, some property bags are not getting converted or access is not there. This came up at various times over the years and I don't recall the exact issue but it's never worked.

A lot of CR dll's are COM based, and it's never going to work, others have tried and as far as I recall they never got it to work.

It's likely a VBA thing...

Don

lawrence_sall
Explorer
0 Kudos

Don;

Thanks for the assist. YEah seen the VBA don't work thing before..... I've gotten around it finally using C# with declared Interface and Interop settings I've also been successful with VB. This one DLL was being a pain.... It was the previous version of CR installed on PC. They had SP05 installed ooooopppppsssss missed that. See my answer below.