vb.net调用fastreport问题

chen_chen024 2009-09-01 02:53:54
m_frxReport = New FastReport.TfrxReportClass
m_frxReport.PrintOptions.ShowDialog = False
m_frxDataTable = New AgricultureESA.Report.FrxDataTable("Table")

If Not Dir(Me.m_PrintFileName) = "" Then
m_frxReport.LoadReportFromFile(Me.m_PrintFileName)
End If
Dim printCharge As DataSet = AgricultureESA.Data.InCharge.indoor(Me.DB_Oper, inChargeNum)
If Not printCharge Is Nothing Then
Try
m_printTable = printCharge.Tables(0) 'datatable
'AgricultureESA.Report.FrxDataTable
m_frxDataTable = New AgricultureESA.Report.FrxDataTable(m_printTable)
m_frxDataTable.AssignToReport(True, Me.m_frxReport)

'TfrxReportClass
m_frxReport.PrepareReport(True)
m_frxReport.PrintOptions.ShowDialog = False
m_frxReport.PrintReport()
Catch ex As Exception
MessageBox.Show("加载报表文件出错!" + ex.Message)
endTry

现在的问题是每次打印后内存都上涨,打印多了之后内存就不能Read了,产生了Bug,我想是有什么资源没有释放,有没有高人指导一下,怎么释放资源,或者我的思路和代码就是不对的,请指点。
...全文
213 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
老董杂货铺 2011-01-21
  • 打赏
  • 举报
回复
没分呀,那你是没有释放吧,看看这个DEMO
http://download.csdn.net/source/2866397

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧