This is a migrated thread and some comments may be shown as answers.

OutOfMemory Exception when RenderForm in Silverlight

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Samuel
Top achievements
Rank 1
Samuel asked on 15 Sep 2011, 07:25 PM
Hello!
I have a code snipplet to create a pdf and send by mail.. but got OutOfMemory when I try to render...
Here's the code:

string strNomeAnexo = prefixoAnexo.ToString() + ".pdf";
                    Assembly assReport = Assembly.Load("CentralPaulista.Report");
                    object objReport = assReport.CreateInstance(strRelatorio);
                    if (strNomeParametro.Count > 0)
                    {
                        strNomeAnexo = prefixoAnexo + strParametro[0] + ".pdf";
                        int intCont = 0;
                        foreach (string parametro in strNomeParametro)
                        {
                            (objReport.GetType().GetProperty("ReportParameters").GetValue(objReport, null) as ReportParameterCollection)[parametro].Value = strParametro[intCont];
                            intCont++;
                        }
                    }
                    IReportDocument objDoc = (IReportDocument)objReport;
                    ReportProcessor processor = new ReportProcessor();    
                      
                    RenderingResult result = processor.RenderReport("PDF", objDoc, null); //Here's the Exception
                     
 
                    MemoryStream arquivo = new MemoryStream(result.DocumentBytes, true);

Any other way I can create this Report?
Thanks!
          

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 20 Sep 2011, 05:26 PM
Hi Samuel,

Improving the performance of Telerik Reporting is a top priority task for us at the moment, so we continue looking for ways to decrease the consumed memory and increase the speed of the report generation process. This means that we would have to perform extensive tests and profiling which are both time consuming tasks and they would require all our focus/efforts for the upcoming releases.

If applicable our suggestion is to implement filtering for the data based on some criteria, so that your users can select only what they need. Thus avoid exporting unnecessary data.

For more general tips check out the Performance Considerations help article.

If you still experience problems after modifying the report according to the above suggestion we will appreciate if you open a support thread and send us a runnable sample project to profile on our end, because it is very hard to give appropriate advise when it comes down to making something work faster/better.

All the best,
Peter
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Samuel
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or