Crystal Report weird error (Unknown Query Engine Error)
If you compile in VS2010 (or VS2012) on a Win7 machine, try adding the following to the app.config:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
If that doesn't work (like on my machine), try compiling in VS2010 on WinXP machine.
Related videos on Youtube
Mustafa Magdy
Updated on August 09, 2022Comments
-
Mustafa Magdy over 1 year
I have a Windows application that uses Crystal Reports 2008 as a reporting tool. It was working fine for a very long period, but yesterday, when I tried to load any report, I got this error:
CrystalDecisions.CrystalReports.Engine.DataSourceException: Unknown Query Engine Error Error in File C:\Users\Magdy\AppData\Local\Temp\rpt_Stock_Cost {DC276D4F-79F4-43B9-8168-24E6B7BF490A}.rpt: Unknown Query Engine Error ---> System.Runtime.InteropServices.COMException: Unknown Query Engine Error Error in File C:\Users\Magdy\AppData\Local\Temp\rpt_Stock_Cost {DC276D4F-79F4-43B9-8168-24E6B7BF490A}.rpt: Unknown Query Engine Error 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 Diamonds.UIL.Forms.frm_ReportViewer.Load_Report(String File_FullPath, DataSet DS) in E:\Development\Bitco\Diamond\Project\Diamond 2.0.1\Diamonds\UIL\Reports\Forms\Viewer\frm_ReportViewer.cs:line 256
Here's the code I used to load and assign data source for the report:
DataSet ds = new DataSet(); reportDocument_.Load(File_FullPath); reportDocument_.SetDataSource(ds);
Where
ds
could be a typed dataset.After some googling, I found some results that say I should have Network Services, user to temp folder in windows. Although I think this is for web applications, not for windows. I tried it for both temp folder, and the above folder in the exception, but neither helped.
I'm using Visual Studio 2010, C# 4.0, Windows Application
Any ideas what could be wrong?
-
Mustafa Magdy almost 13 yearsThanks guys, I found the solution here devshed.us/Blogs/tabid/227/EntryId/314/…
-
Zeina almost 5 yearsThe page is now not found. If you had added this as an answer we could've benefited of that!!
-
Ecchi-Alex almost 3 years@Zeina Luckily the WayBackMachine hardly ever fails us: web.archive.org/web/20110627050710/http://devshed.us/Blogs/… (TL;DR: It's the answer by Tono listed below)
-