reportviewer winform中的System.OutOfMemoryException - 本地报告处理期间发生错误

时间:2016-06-17 11:37:33

标签: .net vb.net winforms report rdlc

我在ReportViewer控件中使用了winform。当数据加载到报告时,它显示错误:

  

本地报告处理期间发生的错误   报告处理中发生意外错误   System.OutOfMemoryException类型的异常

System.OutOfMemoryException details

我在表单加载事件中使用了此代码:

ReportViewr1.ProcessingMode = ProcessingMode.Local
Dim ReportDataSource2 As New Microsoft.Reporting.WinForms.ReportDataSource
ReportDataSource2.Name = RPSet.DataSetName
ReportDataSource2.Value = ds.Tables(0)
ReportViewr1.LocalReport.ReportPath = "C:\Reports\Report1.rdlc"
ReportViewr1.LocalReport.DataSources.Add(ReportDataSource2)
ReportViewr1.RefreshReport()

其中 ds 是我的数据集。 我的系统配置是:
Windows 8.1 64位(正版)
酷睿i7处理器
8 GB DDR3柱塞(1600 FSB)
2 GB DDR5显卡
500 GB SSD  

我发现我的程序内存消耗仅为300到400 MB。 那么为什么会出现内存不足? Only 322 MB consumed by program while processing - details

1 个答案:

答案 0 :(得分:0)

您是否在rdlc中尝试过Tablix或Rectangle的属性。它包含一个像

这样的选项
  

如果可能,将内容保存在一个页面上

可以取消选中。它将尝试在同一页面或单页面中加载页面的内容。这有时会消耗更多的内存。

Uncheck the option

相关问题