0
votes

I am building a report using Crystal Reports and VS2010: ASP.NET/C# which is fairly big (6 pages using OLE Objects), so I am not sure if that would be the cause or solution to this problem, but I need to know either how to fix this or an alternative. All other reports that I built using OLE Objects in the same manner still export just fine.

The code I am using is:

protected void exportPDF_btn_Click(object sender, EventArgs e)
{
    ReportDocument repDoc = getReportDocument(); //regathers the report

    Response.Buffer = false;

    Response.ClearContent();
    Response.ClearHeaders();

    try
    {
        repDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "filename");
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.Message);
        ex = null;
    }
    finally
    {
        Response.End();
    }
}

The problem is that I keep getting an error that says:

Memory Full, Failed to export the report, Not enough memory for operation

Other solutions I have tried:

  • Resetting IIS
  • Restarting Server
  • Installing CutePDF as suggested: Crystal Report 2008 - Memory Full
  • Changing 3rd param from true to false resulting in this line of code:

    repDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "filename");

  • Using ExportToDisk as opposed to ExportToHttpResponse, resulting in this code:

    repDoc.ExportToDisk(ExportFormatType.PortableDocFormat, @"Z:\KFauver\test\file.pdf");

This report is one of the last items that I need to complete to finally be able to push to beta test. However, I am now officially lost as to how to export this to PDF (or anything for that matter). Any help is appreciated! Whether it be a fix or an alternative, ill try it. Thanks in advance.

2
Are your OLE objects pictures?campagnolo_1
Word docs. I split a big word doc into separate pages. On the last one I did, it worked fine.Kevin Fauver
Which service pack of CR are you on? Have you tried exporting to pdf using the viewer?campagnolo_1
I added CR to my VS not too long ago. What do you mean "export using the viewer"? you mean the viewer tab? I need to be able to have a tech in my office access this from the asp.net page and export from there.Kevin Fauver
When you open the asp.net page in a browser, the report gets rendered in a Crystal Reports Viewer. That viewer has an export button among other buttons. Can you export the report using the viewer's button?campagnolo_1

2 Answers

0
votes

Apparently, having 6 instances of a word doc OLE object on a report will cause it to need too much memory. I did not realize this. My fix was to take screenshots of every page and paste the images into the report. Seems to work just fine that way.

0
votes

I had this problem near two weeks ago and my project due to this error was pending. After trying any action like below . Install few PDF printer Update my Crystal report version Change the default Printer and …

At the end my problem has been solved by checked of No printer(optimize for screen display) in crystal report and save the report. Now it works good Thanks