| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 645 人关注过本帖
标题:vb.net水晶报表关闭事件????
只看楼主 加入收藏
huwengui
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:166
专家分:158
注 册:2011-4-22
结帖率:83.33%
收藏
 问题点数:0 回复次数:0 
vb.net水晶报表关闭事件????

报表页面关闭时触发某个事件,释放报表资源。
释放对象为Dim rd As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
rd.Close()

Dim rd As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
            Dim path1 As String = Server.MapPath("~/" + XiTongName + "/UTARpt/" + ReportName + ".rpt")
            rd.Load(path1)
            Dim ReportTime As String = Session("ReportTime")
            Dim path2 As String = Server.MapPath("~/ReportMdb/" + ReportName + Account + ReportTime + ".mdb")
            Dim connectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path2
            Dim conn As New OleDbConnection(connectionstring)
            Dim sqlcx() As String = Session("sql")
            Dim TableName() As String = Session("Table")
            Dim rpttablename() As String = Session("rpttablename")
            Dim ds As New DataSet()
            Dim n As Integer
            For n = 0 To sqlcx.Length - 1
                If sqlcx(n) = "" Then
                    Continue For
                End If
                Dim da As New OleDbDataAdapter("select * from " + TableName(n), conn)
                da.Fill(ds, rpttablename(n))
            Next
            Dim da1 As New OleDbDataAdapter("SELECT * FROM ReportCustomerInfo", conn)
            da1.Fill(ds, "ReportCustomerInfo")
            rd.SetDataSource(ds)
            rd.Database.Tables(0).SetDataSource(ds.Tables(0))
            conn.Close()
            conn.Dispose()
            CrystalReportViewer1.ReportSource = rd
        End If (最后要释放的即为CrystalReportViewer1.ReportSource = rd这个rd)
搜索更多相关主题的帖子: 资源 水晶 
2012-08-13 15:21
快速回复:vb.net水晶报表关闭事件????
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.087588 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved