简体   繁体   中英

Crystal Reports exception in Visual Studio 2013

rptdoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "DO- " + DateTime.Now.ToString("dd-MM-yyyy HHmmss"));

Above line of code is throwing this exception:

An exception of type 'System.MissingMethodException' occurred in CrystalDecisions.CrystalReports.Engine.dll but was not handled in user code

Additional information: Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()'

I am using Visual Studio 2013 and Crystal Reports 13

Once I faced the same issue on my production server. until the day before everything was working good, but the next day, the error was showing up.

After long hours struggling with issue i remembered for some testing reasons, i had changed the "Application Pool Settings -> Enable 32-Bit Applications" to True, while my server is 64bit; i changed it back to false and everything got normal.

If your server is 32 make this option True, otherwise make it false.

在此处输入图片说明

try to add this in your code:

VB.Net

 Imports CrystalDecisions.Shared
 Imports CrystalDecisions.CrystalReports.Engine

C#

using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

and Add a reference to your project for the required dll, or you can install crystal report viewer to your machine

如果您的Windows是x64,请确保将应用程序定位为x64或任何非X86的CPU;如果使用Windows 32位,则请确保将其设置为目标x86

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