Crystal Report is not opening for 64 bit machines
Asked Answered
R

5

10

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.

  1. Windows 10 64 bit
  2. Installed Crystal Reports Tried installing 13.0.20(latest) and restarting PC but didn't work.
  3. Application Target Framework 4.6.2 (i even tried it on 4.0 but same error)
  4. Using Visual Studio 2017 Community (tried VS 2015)
  5. Platform x64 (not AnyCPU)
  6. Reports are being generated by passing DataTable, no active connection or ConnectionString in reports
  7. Error Message

enter image description here

Edit # 1

  1. Web.config includes useLegacyV2RuntimeActivationPolicy="true"
  2. DataTables in x86 and x64 are sameenter image description here

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?

Regression answered 1/6, 2017 at 7:17 Comment(11)
Have you tried this #7192545Fleshy
@Fleshy Referred settings in config are already there.Regression
Does it work in 32 bit (with the memory issue)? Are there some non-standard columns in your dataset (like blobs)?Petterson
@Petterson Yes it is working on 32 bit, i can see the reports. There are no non-standard columns, only date, string, numericRegression
For what it's worth (as of SP 20) SAP doesn't support VS 2017 yet. They say some things might work, like opening an existing project. Have you tried in VS 2015?Poindexter
@JasonHughes once an app is built successfully, i don't think it would depend upon version of VS, it can be run by double clicking the exe file. You might be talking about Report Desinger.Regression
@Regression I am aware that it compiles... but as they have not released an exe for VS 2017, and you are having issues in VS 2017 I thought it worth mentioning. From here "VS 2017 - Tested opening existing app and it works, CR for VS is not integrated into the app so no new CR projects available- should be fully integrated in SP 21"Poindexter
@JasonHughes Tried on VS2015, same errorRegression
Would you mind sharing some code? How do you initialize the report viewer exactly? How exactly are you setting the DataSource of the report? Have you tried passing just the DataSet instead of the DataTable object?Geomorphic
@Geomorphic Source Code has been added, passing DataTable is working fine on x86Regression
Still looking for the solution...Regression
P
2

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?

Poindexter answered 13/6, 2017 at 8:16 Comment(8)
Config settings are already there. It never worked on x64. There is no exception in Source Code. I am using ReportClass so it goes well till end. The error only appears on Viewer.Regression
So you are stepping through and seeing that you have data in your data set before it is used? Or you just don't get an exception until the viewer tries to open the report? If you have no data or weird data in the DataSet during run-time then I would look into the connection itself. Are you using ODBC or something native?Poindexter
There is no connection settings in Report, it only takes data from DataTable.Regression
But you get your data from a connection... so it is possible in runtime that your DataTable or DataSet in x64 is null, NOTHING, empty, or weirdly formatted. That's why I suggest putting a break point at the exact point the DataTable is used, like the SetDataSource call. Then click on the magnifying glass in VisualStudio and inspect the DataTable. Is it different in x86 vs x64?Poindexter
DataTables in x86 and x64 are same, added the screen shot in the questionRegression
So unless there is something really weird, like a data type difference between the two (which you could see inspecting or writing to XML), then it really seems like its a run time issue. I don't have community edition, I only have enterprise, but it is VS 2017. I ran a report in a winforms app on my pc with SP20 intalled in x86 and x64 bit mode. Report rendered fine. So I know its not apples to apples, but you probably should double check your installed files. SAP offers something called Modules that might help...or use something like ProcMon to see if there is a missing dll or something.Poindexter
DataTables are same, ProcMon shows different results, see Edit # 3.Regression
Yeah I don't know. I would be extra sure that you installed the runtime for x64. MSIL indicates, I'm pretty sure, something that can be x86 or x64 (so think Any CPU)... All else fails you should reach out to SAP. I am not sure much support you'll get until they release SP 21.Poindexter
H
0

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.

Hafnium answered 1/6, 2017 at 9:22 Comment(3)
Installed 32 bit version as well but same error. See updated "Installed Crystal Reports" screen shot.Regression
see this #43899515Hafnium
Thanks for the efforts, but referred question is about bitness of PeopleSoft's driver and it has been suggested to use 32bit version of the Crystal Reports Runtime and build the application with platform target x86. While, i need to use x64.Regression
G
0

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>
Geomorphic answered 12/6, 2017 at 15:6 Comment(2)
Same error. Installed CR 13.0.20.2399 64 bit, config setting are already there as sku=".NETFramework,Version=v4.0" because changed to .Net 4.0.Regression
The important part in the config was useLegacyV2RuntimeActivationPolicy="true"Geomorphic
S
0

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

Sultry answered 13/6, 2017 at 7:2 Comment(1)
It is a desktop application.Regression
S
0

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.

Shem answered 3/2, 2018 at 5:6 Comment(2)
All the reports are disconnected, I open the data table from the program and set it as the data source of the report.Regression
Unsure if "disconnected" is enough. Maybe create a simple and brand new project with ONE Crystal report file and your Data Table source, then try again. If not working, try other DataSet - by right-click the CR report and add the DataSet as source.Shem

© 2022 - 2024 — McMap. All rights reserved.