Hi.
After reading some threads about memory management in Telerik Reporting, I noticed that it is a known issue that memory management and performance on the component have some room for improvement. At this moment, I'm facing some challenges to keep the memory usage low when reports are generated, so that I can get my application more scalable and support more concurrent users, and I've been trying some stuff to get around the issue.
We are wondering if it would be a good idea to replace the usage of the ReportViewer control in our web page by using ReportProcessor.RenderReport, using HTML as the format. That way we can just place the resulting HTML on the page and release all resources. Here is how the code would look like:
We thought this approach could be good for two reasons:
1. The call to RenderReport is synchronous and runs on the same thread as the page - that way I have control of when the render finishes, so I can release the resources after everything is done. The call to ReportViewer.RefreshReport() doesn't work that way, as per our observation (seems to run on a separate thread, so we have no way of capturing the moment the report finishes rendering to clear resources).
2. We don't want/need the toolbar provided by the ReportViewer component.
I'd like an opinion from Telerik on the approach above. Does it make sense?
Another question: the code above renders only the first page of the report in HTML. Is there a way I can get the other pages? I couldn't find information about this on the documentation of the RenderReport method.
After reading some threads about memory management in Telerik Reporting, I noticed that it is a known issue that memory management and performance on the component have some room for improvement. At this moment, I'm facing some challenges to keep the memory usage low when reports are generated, so that I can get my application more scalable and support more concurrent users, and I've been trying some stuff to get around the issue.
We are wondering if it would be a good idea to replace the usage of the ReportViewer control in our web page by using ReportProcessor.RenderReport, using HTML as the format. That way we can just place the resulting HTML on the page and release all resources. Here is how the code would look like:
//Note: "ec" below is my Telerik report class |
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); |
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("HTML", ec, null); |
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); |
string htmlResult = enc.GetString(result.DocumentBytes); |
reportProcessor = null; |
result = null; |
lblResult.Text = htmlResult; |
We thought this approach could be good for two reasons:
1. The call to RenderReport is synchronous and runs on the same thread as the page - that way I have control of when the render finishes, so I can release the resources after everything is done. The call to ReportViewer.RefreshReport() doesn't work that way, as per our observation (seems to run on a separate thread, so we have no way of capturing the moment the report finishes rendering to clear resources).
2. We don't want/need the toolbar provided by the ReportViewer component.
I'd like an opinion from Telerik on the approach above. Does it make sense?
Another question: the code above renders only the first page of the report in HTML. Is there a way I can get the other pages? I couldn't find information about this on the documentation of the RenderReport method.