rdlc报告winforms 2015内存泄漏 [英] rdlc report winforms 2015 memory leak
本文介绍了rdlc报告winforms 2015内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 .rdlc
report我的.NET 4.5 Framework中
。
I'm currently working on windows application with a .rdlc
report
within my .NET 4.5 Framework.
一切正常,但对于每个PDF,内存增加大约0.5-1 MB :(我已创建一个循环关于录制PDF的整个逻辑在哪里,我正在做一些接下来的事情。
Everything works well but for every PDF the memory increases about 0.5-1 MB :( I've created a loop where is the whole logic about recording PDF and I'm doing some of next things.
foreach (var bill in billsForPDF)
{
//...
this.newBillsTableAdapter.Fill(this.XXXDataSet.newBills, bill.BillNumber)
//...
contractBindingSource.DataSource = bill.contract;
//...
rptViewerBill.LocalReport.SetParameters(Adresa);
//....
rptViewerBill.RefreshReport();
//...
var pages = new List<byte[]>();
var xxx = rptViewerBill.LocalReport.Render("PDF");
pages.Add(xxx);
PdfDocument docX;
PdfDocument fulldocX = new PdfDocument();
foreach (var item in pages)
{
var PDFstream = new MemoryStream(item);
docX = PdfReader.Open(PDFstream, PdfDocumentOpenMode.Import);
CopyPages(docX, fuldocX);
}
fulldocX.Save(@"C:..."+bill.billNumber.ToString()+".pdf");
/*here i'm tried almost everything with GC and disposing LocalReport, clear, null...but nothing works */
}
比尔 .rdlc
I
有一个expr like =
In Bill.rdlc
I
have an expr like =
"Bill number: " & First(Fields!billNumber.Value, "DataSet1")"
有人可以帮忙吗?
Can anyone help?
推荐答案
嗨amirpi,
Hi amirpi,
感谢您在此发帖。
由于您的问题与winform论坛有关。我会将案例移至那里。
Since your issue is related to winform forum. I will move the case to there.
最佳 问候,
Best Regards,
Hart
这篇关于rdlc报告winforms 2015内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文