ReportViewer抛出OutOfMemory异常 [英] ReportViewer throws OutOfMemory exception

查看:100
本文介绍了ReportViewer抛出OutOfMemory异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在报告查看器中显示包含8-10,000个记录的数据表时遇到问题。在尝试呈现报告一段时间后,它会显示OutOfMemory异常。该过程使用的内存高达5-700MB(我有2GB RAM)。

我想报告查看器的内部存在限制。我感兴趣的是一种解决方法。可以将报告分成页面帮助吗?在这种情况下,报告是否只加载当前页面?因为我读了其他页面被加载到后台,这对我来说没有任何帮助,因为前景或背景无关紧要,只要它没有内存。

我该怎么办?闯进页面?我尝试了几次(PageHeight,BreakPageAtEnd等)但没有任何效果,我有一个单行页面有10,000行。


Microsoft MVP VC ++ | www.mariusbancila.ro/blog | www.codexpert.ro

解决方案

嗨Marius Bancila,
你能告诉我你为这份报告传递了什么类型的数据源,如果你使用数据集(数据表)的机会,则异常更多。
即使我使用数据集填充100000条记录,结果也以同样的异常结束。在我淘洗之后,我已经使用BusinessObjects和LINQ转储了DataSet,它在不到2分钟的时间内呈现了我的报告。

所以试试看......希望我的回答能帮助你<登记/>
问候

Hi,

I have a problem displaying data tables with 8-10,000+ records in the Report viewer. After some time while it tries to render the report, it shows an OutOfMemory exception. The memory used by the process goes up to 5-700MB (I have 2GB RAM).

I guess there is a limitation in the internals of the report viewer. What I'm interested in is a workaround. Could breaking the report into pages help? Would the report in this case load only the current page? Because I read the the other pages are loaded into background, which would be of no help to me, since foreground or background doesn't matter as long as it goes out of memory.

And what should I do to break into pages? I tried several times (PageHeight, BreakPageAtEnd, etc.) but nothing work, I have one single page with 10,000 rows.


Microsoft MVP VC++ | www.mariusbancila.ro/blog | www.codexpert.ro

解决方案

Hi Marius Bancila,

Could you please tell me what type of data source are you passing for the report, if you are using Data Set(Data Table) chance of gettin that exception are more.
even i used Data Set to populate 100000 records result ended with the same exception. After my scouring i have dumped DataSet with  BusinessObjects and LINQ which rendered my report in less than 2 mins.

So try this out......Hope my answer will help you


Regards


这篇关于ReportViewer抛出OutOfMemory异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆