加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

机房收费系统之报表总结2

发布时间:2020-12-17 08:05:43 所属栏目:百科 来源:网络整理
导读:在上一篇中已经说了如何构建报表模板,接下来就是用 vb 调用报表模板以此来实现报表的输出。下面是一些具体的过程: ’定义报表 Dim Report As grproLibCtl.GridppReportPrivate Sub cmdPrint_Click() ‘打印报表 Report.[Print] (True)End Sub Private Sub

在上一篇中已经说了如何构建报表模板,接下来就是用vb调用报表模板以此来实现报表的输出。下面是一些具体的过程:

’定义报表
Dim Report As grproLibCtl.GridppReport

Private Sub cmdPrint_Click()

‘打印报表

    Report.[Print] (True)

End Sub

 

Private Sub cmdPrintPreview_Click()

’打印预览

    Report.PrintPreview (True)

End Sub

Private Sub cmdRefresh_Click()

‘刷新报表

    txtSQL = "select * from daybill_Info where daydate='" & Format(Date,"yyyy-mm-dd") & "'"

    Report.DetailGrid.Recordset.QuerySQL = txtSQL

    GRDisplayViewer1.Refresh

End Sub

Private Sub Form_Load()

 '将日结账单以报表形式显示出来

    '建立查询语句

    txtSQL = "select * from daybill_Info where daydate='" & Format(Date,"yyyy-mm-dd") & "'"

    '创建报表对象

    Set Report = New grproLibCtl.GridppReport

    '载入报表模板文件

    Report.LoadFromFile (App.Path & "报表日结账单1.grf")

    '设置数据连接串

    Report.DetailGrid.Recordset.ConnectionString = ConnectionString()

    '载入查询语句

    Report.DetailGrid.Recordset.QuerySQL = txtSQL

    '显示报表中的内容

    GRDisplayViewer1.Report = Report

    GRDisplayViewer1.Start

End Sub

而在周结账单中只要引进参数即可:

'设置报表参数

Report.ParameterByName("datestart").AsString = Str(startTime.Value)

Report.ParameterByName("dateend").AsString = endTime.Value

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读