Hello,
I'm using the CrystalDecisions.CrystalReports.Engine.dll to generate custom rtf file reports in VS2010.
I have also installed "Crystal Reports 2008 Runtime SP2".
In the _reportdata object there is one dataset with 15 rows. At this point the report generates perfectly. When there are 25 rows for example, the ExportToDisk function throws a OutOfMemory Exception. The report is approx. 3 MB so not that big at all.
Any ideas?
Piece of code:
using (CrystalDecisions.CrystalReports.Engine.ReportDocument reportDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument())
{
reportDocument.Load(reportFile); //.rpt file
reportDocument.SetDataSource(_reportData); //Datarows for the report
reportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.RichText, outputRTFFile); //Generates OutOfMemory Exception
}
Stacktrace:
at System.StubHelpers.ObjectMarshaler.ConvertToManaged(IntPtr pSrcVariant)
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
dll version:
12.0.2000.0
Request clarification before answering.
You have the wrong version of the SDK to work with VS 2010 - CR 2008 is not supported in VS 2010. You need to use the "Crystal for Visual Studio" SDK that is described and available through this page:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
Be sure to read the page to see what has changed since Crystal 2008. When you follow the link to download the SDK, you'll need to enter your name and email address. On the next page, use the orange button to download the integration with Visual Studio. This will be installed on the developer workstation. The blue buttons at the bottom of the screen are for the various available runtime installs that you would use when you deploy your application. DO NOT install the runtimes on the developer workstation!
The current service pack is SP23. The version that you develop with must match the runtime that you deploy with your application.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried with this service pack and now the following error occurs:
Error: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
Some of the solutions on stackoverflow were saying that we can solve this by changing the target to x86 or ANY. But same result.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.