I have Telerik Report that have about 700 images on it. When I generate the pdf, I get the following error message:
Here is the code that I uses.
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", tk, null);
FileStream fs = new FileStream("d:\\report1.pdf", FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Flush();
fs.Close();
However, when I display that in the report viewer on the screen, there is no error. Any idea on how to fix this? I have plenty of diskspace in c:/d: drives.
Thanks.
System.OutOfMemoryException was unhandled by user code
Message=Exception of type 'System.OutOfMemoryException' was thrown.
Source=mscorlib
StackTrace:
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Telerik.Reporting.Pdf.IO.PdfWriter.Write(Byte[] bytes)
at Telerik.Reporting.Pdf.IO.PdfWriter.WriteStream(PdfDictionary value)
at Telerik.Reporting.Pdf.PdfDictionary.WriteDictionaryStream(PdfWriter writer)
at Telerik.Reporting.Pdf.PdfDictionary.WriteObject(PdfWriter writer)
at Telerik.Reporting.Pdf.PdfDocument.Save(Stream stream)
at Telerik.Reporting.ImageRendering.DocumentPdf.EndDocument()
at Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.Writing.IWriter.WriteEndDocument()
at Telerik.Reporting.BaseRendering.PageHandler.Telerik.Reporting.Paging.IPageHandler.EndDocument(Boolean output)
at Telerik.Reporting.Paging.PagerBase.AddEndDocument(Boolean output)
at Telerik.Reporting.Paging.PageComposition.PageOverride()
at Telerik.Reporting.Paging.PagerBase.Page(IPageHandler handler, Report report)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingInfo, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
at Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderReportStateless(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo)
at _ViewReport.rdbGo_Click(Object sender, EventArgs e) in d:\SVN\ROVCatalog\Web\ViewReport.aspx.cs:line 89
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
Hi ,
I am having trouble loading a lot of data records Report, and when I try to download a report in PDF format, it takes 15 minutes and fails to download with the message "Invalid Credential."
Can you give me a good solution for that
thanks
Hi Sudanshu,
The message "Invalid Credentials" may be coming from a database server or another service. You may get the exact stack trace of the error by attaching a Trace Listener to the application hosting the Reporting engine.
Regarding the slow rendering, please, take a look at the following resources that give hints on where the problem may be coming from and how you may improve the performance: