cancel
Showing results for 
Search instead for 
Did you mean: 

CR13 SP26 Visual Studio Error CrystalReports.Engine.DataSourceException

0 Kudos

I have been working in Visual Studio 2017 with CR13SP25 and went to add another report. However, the 'Reporting' folder in the Toolbox was missing. Crystal Reports is also missing from the 'Add new' menu. I upgraded to CR13 SP26, which brought those menu items back but now it is throwing an error when trying to load the dataset. I reverted back to SP25, and printed the report just fine, but the menu items are missing again. The dataset is coming from an XML serialization (code posted below). Any idea on how to get this to work in either package?

CrystalDecisions.CrystalReports.Engine.DataSourceException: Error in File temp_7860d069-b58b-4be6-847f-941a1b6bd46d 9440_12448_{F0FC6F00-172F-45E1-A817-C49361900543}.rpt:
Failed to load database information. ---> System.Runtime.InteropServices.COMException: Error in File temp_7860d069-b58b-4be6-847f-941a1b6bd46d 9440_12448_{F0FC6F00-172F-45E1-A817-C49361900543}.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)

Source code:

namespace SORReceipts.Receipts
{
public partial class dspReceiptModify : Form
{
protected static string _username = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Split('\\')[1];
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static DataSet data = null;

public dspReceiptModify(ReceiptTransaction receipt)
{
log.Info("Printing Receipt Modified Started");
InitializeComponent();
log.Info(" -- InitializeComponent complete");
log.Info("Printing Receipt Modified Completed");
PrintReceipt(receipt);
}

public void PrintReceipt(ReceiptTransaction receipt)
{
receipt.DateStringForPrinting = receipt.TransactionDateStamp.ToString("MM/dd/yyyy h:mm tt");
receipt.DatePrinted = DateTime.Now.ToString("MM/dd/yyyy h:mm tt");

try
{
var xmlDocument = new XmlDocument();
var serializer = new XmlSerializer(receipt.GetType());

rptReceiptModify prntreceipt = new rptReceiptModify();

using (var stream = new MemoryStream())
{
serializer.Serialize(stream, receipt);
stream.Flush();
stream.Seek(0, SeekOrigin.Begin);
xmlDocument.Load(stream);
}

var context = new XmlParserContext(null, new XmlNamespaceManager(new NameTable()), null, XmlSpace.None);
var reader = new XmlTextReader(xmlDocument.OuterXml, XmlNodeType.Document, context);

data = new DataSet();

data.ReadXml(reader);

SetPrinterSettings.SetPrinter(prntreceipt);

string printer = prntreceipt.PrintOptions.PrinterName.ToString();

prntreceipt.SetDataSource(data);
crystalReportViewer1.ReportSource = prntreceipt;

string _prntFileName = "Reciept_" + receipt.TransactionID.ToString() + "_" + receipt.DatePrinted.Replace("/", "_").Split(' ')[0];
prntreceipt.SummaryInfo.ReportTitle = _prntFileName;

prntreceipt.PrintToPrinter(1, false, 0, 0);
log.Info(" -- Receipt " + receipt.TransactionID.ToString() + "Printed");
crystalReportViewer1.ReportSource = null;
data.Reset();
}
catch (Exception ex)
{
LoggingHelper.Exceptionthrown("Failed to print Modified Receipt", ex);
if (UserMessaging.PrintFailed())
{
PrintBackupReceipt(data, receipt);
}
}
}

peter_herzog
Discoverer
0 Kudos

Hi i have the same Problem. I dont have installed msi and i have checked the config in the web.config. all assemblies are 13.0.4

peter_herzog
Discoverer
0 Kudos

CrystalDecisions.CrystalReports.Engine.DataSourceException
HResult=0x80041700
Nachricht = Fehler in der Datei temp_1fa094f3-28a7-4b53-a107-9842d112b712 24212_18552_{6A5D0444-AB6B-44C9-BAFF-50499DB4836D}.rpt:
Fehler beim Laden der Datenbankinformationen
Quelle = <Die Ausnahmequelle kann nicht ausgewertet werden.>
Stapelüberwachung:
<Die Ausnahmestapelüberwachung kann nicht ausgewertet werden.>

Innere Ausnahme 1:
COMException: Fehler in der Datei temp_1fa094f3-28a7-4b53-a107-9842d112b712 24212_18552_{6A5D0444-AB6B-44C9-BAFF-50499DB4836D}.rpt:
Fehler beim Laden der Datenbankinformationen

Accepted Solutions (1)

Accepted Solutions (1)

ONLY install the EXE onto your DEV PC, don't install the MSI packages.

Go to Programs and Features and verify you only have the CR for VS and 64 bit runtime package installed.

Did you remove the LegacyMode from the App.config file?

It's no longer required and can cause problems if used.

Also verify all assemblies in your project are now 13.0.4000.0

0 Kudos

Thanks Don for your quick reply.

I think that it was the msi / exe problem. While I was waiting for a reply I uninstalled CR13SP25 rebooted, then I saw you replied so I installed the CR13SP26 exe version. Gave it a test and it worked without throwing an error.

I have Crystal Reports XI R2, and CR XI Release 2 .NET 2005 Server, CR runtime engine for .net and CR version for Visual Studio installed. I have to keep the CR XI R2 and server installs for other uses.

Did a text search for 'Legacy' in the App.config and nothing returned.

Assembles are 13.0.4000.0

Think its ok now, thank you for your help.

Answers (1)

Answers (1)

peter_herzog
Discoverer
0 Kudos

i have deinstalled both runtime and cr for visual studio, and then i have installed new, it works in vs2017 and vs2019!!

?????

i dont know why;

there mus be an error in update-procedure

0 Kudos

Thanks Peter, this worked for me as well...perhaps an issue with Upgrade vs Install.