问题
My reports work fine on a 32 bit machine but won't open on 64 bit. 64 bit is required because loading data on one of the screen causes a memory issue - so it can't work on 32 bit.
- Windows 10 64 bit
- Installed Crystal Reports Tried installing 13.0.20(latest) and restarting PC but didn't work.
- Application Target Framework 4.6.2 (i even tried it on 4.0 but same error)
- Using Visual Studio 2017 Community (tried VS 2015)
- Platform x64 (not AnyCPU)
- Reports are being generated by passing DataTable, no active connection or ConnectionString in reports
- Error Message
Edit # 1
- Web.config includes
useLegacyV2RuntimeActivationPolicy="true"
- DataTables in x86 and x64 are same
Edit # 2
Source Code for showing the report is
CrystalDecisions.CrystalReports.Engine.ReportClass c = new
CrystalDecisions.CrystalReports.Engine.ReportClass();
c.FileName = System.IO.Path.Combine(Root_Path,
"Reports", "Prod", mFileName);
c.Load();
c.SetDataSource(dt); // dt => DataTable
c.SetParameterValue("prmSystemDate", Current_Date);
frmReportViewer v = new frmReportViewer();
v.ReportClass = c;
v.Show();
And frmReportViewer FormLoad is
private void frmReportViewer_Load(object sender, EventArgs e)
{
CRViewer.ReportSource = ReportClass;
//CRViewer =>
//CrystalDecisions.Windows.Forms.CrystalReportViewer
}
Have I gone wrong somewhere?
Edit # 3
DataTable on x86 and x64 are same. (saved the datatables in xml and both files are exactly the same).
Process Monitor shows that my program performs CreateFile
operation on following files
C:\WINDOWS\Microsoft.Net\assembly\GAC_64\CrystalDecisions.Web\v4.0_13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\CrystalDecisions.Web\v4.0_13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll C:\WINDOWS\Microsoft.Net\assembly\GAC\CrystalDecisions.Web\v4.0_13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll C:\WINDOWS\assembly\GAC_64\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll
All fails with PATH NOT FOUND
Result. It succeeds on
C:\Windows\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll
and then two BUFFER OVERFLOW
occurs on this same file.
It only happens on x64. There is no operation related with CrystalDecisions.Web.dll
on x86.
What does it indicate?
回答1:
This might not be an complete "answer" since you're still troubleshooting, and asking for help, but its too long for a comment. Of note, at this time SAP does not support VS 2017, and there is possibility that has something to do with this, but I've seen similar messages even back in VS 2010 so here goes...
Short guess add this to your app.config file:
<startup useLegacyV2RuntimeActivationPolicy="true"></startup>
or more specifically target .NET like:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
Longer troubleshooting thought process. The error message usually would indicate that the DataSet (DataTable in this case) is not set at the time it is used in the report object. You could put a breakpoint there and see if this is true (where SetDataSource is used).
It might be that I am wrong here and there is a properly set DataSet even at that point, and the issue happens a little later in the viewer. I ran into issues like this a long time ago and if memory serves this was the route I took to track down a solution.
Basically my problem was the way the EXE was using ADO objects in the viewer. Without knowing everything about your project I would start down this path to debug.
Other questions would be does it work in VS 2015? Did it ever work in X64 and stop working? Does it work for other operations, like can you access the report object programatically, and it's only erring in viewer?
回答2:
Install the 32 bit version of Crystal Reports, even though your machine is 64 bit.
My machine is also 64, but I use the 32 bit version of the software and it works fine.
回答3:
Make sure you got the latest SP installed. I am currently using SP19, which gives me no trouble.
I know it can be a pain to find the right download links, this might help you out:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
Because I've created a WPF applicatuons that uses the provided viewer from CrystalReports, I also had to use the following setting in my App.config
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
回答4:
I don't know if this is useful for you or not. but I came across following solution when I had issue with server 2012.
Framework 4.6 causes Crystal Reports for Visual Studio to create a unique folder path to the Crystalreportsviewer13 folder in IIS and IISExpress DEV.
Environment
Crystal Reports for Visual Studio
Windows 7
Windows 8.x
Windows 2012 Server
Windows 2016
Windows 10
Reproducing the Issue
We’re aware of such problem. Actually it’s related to .Net Framework 4.6, not only limited to Win10 or Windows Server 2016 preview(these OS by default installed .Net 4.6 ). If you install .Net 4.6 on Win7 there will be same issue. The root cause is MS provide the update to .Net Framework 4.6 via windows update, then the small version of .Net 4.6 will changed. For ASP.NET web site target to .Net 4.6 app pool, CR viewer will try to find the viewer resource file(js & icon) from ..\aspnet_client\system_web\4_6_xx\crystalreportviewers13\ The highlight xx is the small version of .Net Framework 4.6. On Win10 RTM, it’s 4_6_79; on Win7+.Net 4.6 it’s 4_6_81, if user installed recent KB3098786 it will be 4_6_118… The version number will change again if next KB update for .Net Framework 4.6. So please create a BOSAP case for it. At least in SP16 we need add more symbol link to support different small version of .Net Framework 4.6. And a better solution is change the path of viewer resource file loaded, eg, point to a virtual folder under IIS. That required fix in Viewer side and need more time, we will try to implement it in SP16… Thanks, Soda
Resolution
Our Developers are aware of this issue and we should be able to provide a fix in Service Pack 16
The issue is related to .Net Framework 4.6.
The root cause is MS provide the update to .Net Framework 4.6 via Windows Update
ASP.NET web site will target the .Net 4.6 app pool, CR viewer will try to find the viewer resource file(js & icon) from
..\aspnet_client\system_web\4_6_xx\crystalreportviewers13\
The xx is the small version of .Net Framework 4.6.
For example on Win10 RTM, it is 4_6_79;
on Win7+.Net 4.6 it is 4_6_81,
if user installed recent KB3098786 it will be 4_6_118x.
The version number will change again when the next KB update for .Net Framework 4.6 is installed.
Current work around is to update the Web.Config file to include the updated version of the Framework
And then to copy the \CrystalReportsViewer13 folder into the new path:
..\aspnet_client\system_web\4_6_xx\crystalreportviewers13\
For updates and the latest downloads please go to this link:
http://scn.sap.com/docs/DOC-7824
Home page is:
http://scn.sap.com/community/crystal-reports-for-visual-studio
回答5:
Do you have any data source or connection (e.g. odbc\dao) with 32-bit in your Crystal Report DataSource? It is also strange that you already installed 32-bit and 64-bit CR runtimes, why you installed CR versions for visual studio? I had a similar problem as yours, but after replaced 32-bit MDB and DAO with DataSet, everything becomes fine. I installed both 32-bit and 64-bit CR runtimes.
来源:https://stackoverflow.com/questions/44300956/crystal-report-is-not-opening-for-64-bit-machines