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.