简体   繁体   中英

Crystal Report || Windows Form || Application Crash || Fault Module Name : crqe.dll

I have two application

  1. Web Application which exports crystal reports to PDF and shows in the browser. It is deployed on Windows Server 12 R2
  2. A library project who does the same thing except showing it in the browser, it stores the output in a folder. This library project is being utilized by Windows form application

Environment

  1. Crystal Reports 2013
  2. Crystal Reports for .NET Framework 4.0 (64 bit)
  3. .Net framework 4.5.1

When I am running the application on my dev machine which is Windows 10, it works fine without any issue but when I run it on Server which is Windows Server 2012 R2 then application crashes. Below is the crash screenshot. 崩溃错误窗口

This is crashing when application is setting datasource. Below is the code:

              foreach (CrystalDecisions.CrystalReports.Engine.Table _t in rpt.Database.Tables)
                {
                    try
                    {
                        if (ds.Tables[_t.Name] != null)
                        {
                                _t.SetDataSource(ds.Tables[_t.Name]);
                        }
                    }
                    catch (Exception e)
                    {
                       LogMessage(string.Format("Unable to SetDataSource for table {0}  {1}", _t.Name, e.ToString()));
                        return false;
                    }
                }

Application is crashing at _t.SetDataSource(ds.Tables[_t.Name]); this line. On the same server, web application is working fine. But getting issues while running it through separate process. Both the library and windows app is set to Any CPU. I also tried it with 64 bit also but failed.

I was using.Net frameowrk 4.7 and on server it was 4.0 and crystal report version I was using was targeted to 4.0

Changed the target framework of the csproj files to 4.0 and it started working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM