问题描述
我们正在 LocalReports 模式下使用 RDLC 报表查看器(VS2008 SP1),在 32位Win2K3 VM上使用 DB2数据库 4GB RAM):
当发出多个大型报告请求(< 6000条记录)时,报表查看器渲染报表的速度非常慢,并且在一段时间后导出到EXCEL超时。
我们在VM上有4GB的内存,其中我们注意到通常只使用大约600MB(总服务器内存)而且我们曾经出现Out of Memory错误。
我们尝试使用/ 3G选项扩展物理寻址(http://msdn.microsoft.com/en-us/library/aa366796%28VS.85%29.aspx),之后内存使用量增加到~1.2 GB(服务器内存总使用量)。
在此之后,服务器响应稍微好一点,初始响应更快但渲染速度缓慢。导出到excel功能现在不会引发内存不足异常,但会在一段时间后超时(约20分钟)
这是我们的aspx文件中的reportviewer标记。
< rsweb:ReportViewer ID = QUOT; MainReportViewer" RUNAT = QUOT;服务器"字体-名称= QUOT;宋体" Font-Size =" 8pt"
BorderStyle =" None" ExportContentDisposition = QUOT; AlwaysInline"宽度= QUOT; 100%QUOT; HyperlinkTarget =" _blank"
ShowBackButton =" True" OnDrillthrough = QUOT; MainReportViewer_Drillthrough" OnBack =" MainReportViewer_Back"
AsyncRendering =" true" ShowRefreshButton = QUOT假QUOT; SizeToReportContent = QUOT假QUOT;
OnReportError =" MainReportViewer_ReportError">
< LocalReport EnableHyperlinks =" true">
< / LocalReport>
< / rsweb:ReportViewer>
这是我们用来绑定数据的代码。
DataSet reportDataSet = //从DB获取数据HERE
report.DataSources.Add(new ReportDataSource(dataSourceName,reportDataSet.Tables) [0]));
RDLC非常简单,数据大约有6000条记录。
我们尝试在报表查看器上添加错误处理程序,但是无法捕获内存不足异常因为错误处理程序永远不会被调用。
建立你的帮助。
We are using RDLC Report Viewer (VS2008 SP1) in LocalReports mode with DB2 database on 32-bit Win2K3 VM (4GB RAM) :
When multiple requests for large reports (<6000 records) are made, the reportviewer is very slow in rendering the report and export to EXCEL timesout after sometime.
We have 4GB of memory on the VM, of which we noticed that only around 600MB (total server memory) was typically used and we used to get Out of Memory error.
We tried with the /3G option to extend physical addressing (http://msdn.microsoft.com/en-us/library/aa366796%28VS.85%29.aspx), after which the memory usage increased to ~1.2 GB (total server memory usage).
After this the server response was a little bit better, initial response is quicker but slowly the rendering gets sluggish. The export to excel functionality does not throw an out of memory exception now but timesout after sometime (~20 mins)
This is the reportviewer tag in our aspx file.
<rsweb:ReportViewer ID="MainReportViewer" runat="server" Font-Names="Verdana" Font-Size="8pt"
BorderStyle="None" ExportContentDisposition="AlwaysInline" Width="100%" HyperlinkTarget="_blank"
ShowBackButton="True" OnDrillthrough="MainReportViewer_Drillthrough" OnBack="MainReportViewer_Back"
AsyncRendering="true" ShowRefreshButton="false" SizeToReportContent="false"
OnReportError="MainReportViewer_ReportError">
<LocalReport EnableHyperlinks="true">
</LocalReport>
</rsweb:ReportViewer>
And this is the code we use to bind the data.
DataSet reportDataSet = //Get Data from the DB HERE
report.DataSources.Add(new ReportDataSource(dataSourceName, reportDataSet.Tables[0]));
The RDLC is quite simple and data is about 6000 records.
We tried adding an error handler on the report viewer, but was not able to capture the out of memory exception as the error handler never gets called.
Apprecaite your help.
推荐答案
关注此链接http://msdn.microsoft.com/en-us/library/ms251692.aspx
[OR]
在绑定到报告查看器后尝试处理DataSet
希望这会帮助您
Follow this LINK http://msdn.microsoft.com/en-us/library/ms251692.aspx
[Or]
Try to dispose DataSet after you bind to Report Viewer
Hope this will Help You
这篇关于RDLC Localreports - 缓慢呈现大型报告(6000条记录)和导出到Excel时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!