none
CrystalDecisions.CrystalReports.Engine ReportDocument OutOfMemory Exception VS2010 RRS feed

  • Question

  • 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

    • Moved by May Luo-MSFT Thursday, October 25, 2018 2:18 AM off-topic issue
    Wednesday, October 24, 2018 6:16 PM

All replies

  • Hi David,

    Welcome to the MSDN forum.

    Refer to your description, your issue is about the Crystal Report development. Since our forum is to discuss the VS IDE, please redirect to this appropriate forum: https://www.sap.com/community.html to seek for a better support, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 25, 2018 1:50 AM