Grid++Report 入手教程:VB 通过Grid Report 显示时间
来源:互联网 发布:高中地理视频教学软件 编辑:程序博客网 时间:2024/06/08 14:32
机房收费系统中的“周结账单”有一个功能是根据选定时间的范围,显示相应的账单数据,这时就用到了“参数”的设定。
首先,在"报表主对象"中插入参数:右击"参数集合"--插入--参数(DateBegin 和DateEnd)
然后,在报表模版中插入综合文字框:--插入--部件框--综合文字框,然后点击文字框,在里面输入参数名和显示的文字,格式为[#Parameter1#],如图所示(设定了时间显示格式):
首先,在VB中添加部件:Grid++Report Engine5.0 Type Libirary
在VB中,设置相应的代码:
'定义变量具有相对应的事件Dim WithEvents Report As grproLibCtl.GridppReportPrivate Sub Form_Load() '创建报表对象 GRDisplayViewer1.Stop Set Report = New grproLibCtl.GridppReport '载入报表模板文件,保证相对路径 Report.LoadFromFile (App.Path + "\ChargeCheckDay.grf")
'设置数据库连接字符串 Report.DetailGrid.Recordset.ConnectionString = "Provider=SQLOLEDB;Data Source=192.168.24.54;Initial CataLog=Charge_zlj;UID=sa;PWD=123456" '显示日结账中,最新一条记录 Report.DetailGrid.Recordset.QuerySQL = "select top 1 * from CheckDay order by Date desc" '设置报表查询显示器控件的关联报表对象 GRDisplayViewer1.Report = Report '启动报表运行 GRDisplayViewer1.Start End SubPrivate Sub Report_Initialize()'设置各个参数的值'开始时间 Report.ParameterByName("DateBegin").AsString = Format$(DTPBegin.Value, "yyyy-mm-dd") '显示开始日期'结束时间 Report.ParameterByName("DateEnd").AsString = Format$(DTPEnd.Value, "yyyy-mm-dd") '显示结束日期End SubPrivate Sub cmdPrint_Click() '打印 '因为报表对象的 Print 方法名与 VB 内部定义有冲突,所以要用中括号括起来 Report.[Print] (True)End SubPrivate Sub cmdPrintPrevious_Click() '打印预览 Report.PrintPreview (True)End Sub
效果如图所示:
- Grid++Report 入手教程:VB 通过Grid Report 显示时间
- Grid++Report 入手教程:制定模板报表
- 当VB遇上grid report
- Grid++Report
- Grid++Report简介
- Grid++Report 构件组成
- Grid++Report工作原理
- Grid++Report 发布
- 使用报表grid++report
- grid+report简单使用
- grid++REPORT 初识
- Grid++Report web
- 关于grid++report篇
- grid++report中篇
- grid++report详解
- grid++report子报表
- 【机房收费系统】VB与grid++report交互(如何让数据以报表格式显示)
- Grid++report数字格式设置
- 最近android面试问题总结,你会几个?
- Android SDK更新以及ADT更新出现问题的解决办法
- 九度oj 1031 XXX定律
- UNIX环境高级编程--第9章总结
- 计算机专业的学习资料与个人对本专业的理解
- Grid++Report 入手教程:VB 通过Grid Report 显示时间
- 指针遍历vector向量
- 腾讯开放平台相关内容
- java.lang.Excetion,java.lang.RuntimeException,java.lang.Error有什么区别?
- 统计单词数 c算法
- ubuntu trash 垃圾箱的文件存储位置
- http://blog.csdn.net/wgwxf/article/details/7804027
- 利用fseek和ftell求文件的长度(字节数)
- Ubuntu 9.10 麦克风无声音解决方法