ReportX实例(3)VB
来源:互联网 发布:淘宝卖家如何投诉买家 编辑:程序博客网 时间:2024/05/18 02:07
本例子下载地址:http://download.csdn.net/source/334323
使用步骤:
1、注册控件ReportX.ocx(本压缩包内不包含ReportX.ocx,如果需要请到http://download.csdn.net/source/275430下载)
代码:
Private Sub AppendCol_Click()
ReportX1.AppendCol 1
End Sub
Private Sub AppendRow_Click()
ReportX1.AppendRow 1
End Sub
Private Sub Copy_Click()
Dim SelectMinx As Long
Dim SelectMiny As Long
Dim SelectMaxx As Long
Dim SelectMaxy As Long
ReportX1.GetSelectCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
ReportX1.CopyCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
End Sub
Private Sub Cut_Click()
Dim SelectMinx As Long
Dim SelectMiny As Long
Dim SelectMaxx As Long
Dim SelectMaxy As Long
ReportX1.GetSelectCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
ReportX1.CutCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
End Sub
Private Sub DeleteCol_Click()
Dim SelectMinx As Long
Dim SelectMiny As Long
Dim SelectMaxx As Long
Dim SelectMaxy As Long
ReportX1.GetSelectCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
ReportX1.DeleteCol SelectMinx, SelectMaxx - SelectMinx + 1
End Sub
Private Sub DeleteRow_Click()
Dim SelectMinx As Long
Dim SelectMiny As Long
Dim SelectMaxx As Long
Dim SelectMaxy As Long
ReportX1.GetSelectCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
ReportX1.DeleteRow SelectMiny, SelectMaxy - SelectMiny + 1
End Sub
Private Sub Form_Resize()
ReportX1.Width = Form1.Width - 120
ReportX1.Height = Form1.Height - 1350
End Sub
Private Sub Frozen_Click()
Dim Inputx As Long
Dim Inputy As Long
ReportX1.GetInputCell Inputx, Inputy
ReportX1.SetFrozenCol ReportX1.LeftCol, Inputx - 1
ReportX1.SetFrozenRow ReportX1.TopRow, Inputy - 1
End Sub
Private Sub InsertCol_Click()
Dim Inputx As Long
Dim Inputy As Long
ReportX1.GetInputCell Inputx, Inputy
ReportX1.InsertCol Inputx, 1
End Sub
Private Sub InsertRow_Click()
Dim Inputx As Long
Dim Inputy As Long
ReportX1.GetInputCell Inputx, Inputy
ReportX1.InsertRow Inputy, 1
End Sub
Private Sub Merge_Click()
Dim SelectMinx As Long
Dim SelectMiny As Long
Dim SelectMaxx As Long
Dim SelectMaxy As Long
ReportX1.GetSelectCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
ReportX1.MergeCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
End Sub
Private Sub New_Click()
ReportX1.NewReport 30, 100
End Sub
Private Sub NoFrozen_Click()
ReportX1.SetFrozenCol 0, 0
ReportX1.SetFrozenRow 0, 0
End Sub
Private Sub Open_Click()
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
ReportX1.OpenReport CommonDialog1.FileName
End If
End Sub
Private Sub PageSetup_Click()
ReportX1.PrintSetup
End Sub
Private Sub Paste_Click()
Dim Inputx As Long
Dim Inputy As Long
ReportX1.GetInputCell Inputx, Inputy
ReportX1.Paste Inputx, Inputy, True
End Sub
Private Sub Preview_Click()
ReportX1.Preview
End Sub
Private Sub Print_Click()
ReportX1.Print True
End Sub
Private Sub Save_Click()
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
ReportX1.SaveReport CommonDialog1.FileName
End If
End Sub
Private Sub SetScript_Click()
Dim Inputx As Long
Dim Inputy As Long
ReportX1.GetInputCell Inputx, Inputy
ReportX1.EditCellScript Inputx, Inputy
End Sub
Private Sub Split_Click()
Dim SelectMinx As Long
Dim SelectMiny As Long
Dim SelectMaxx As Long
Dim SelectMaxy As Long
ReportX1.GetSelectCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
ReportX1.SplitCell SelectMinx, SelectMiny, SelectMaxx, SelectMaxy
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case (Button.Index)
Case 1:
New_Click
Case 2:
Open_Click
Case 3:
Save_Click
Case 5:
PageSetup_Click
Case 6:
Preview_Click
Case 7:
ReportX1.Print False
Case 9:
Cut_Click
Case 10:
Copy_Click
Case 11:
Paste_Click
Case 13
Merge_Click
Case 14
Split_Click
Case 16:
InsertCol_Click
Case 17
InsertRow_Click
Case 18:
DeleteCol_Click
Case 19
DeleteRow_Click
Case 20:
AppendCol_Click
Case 21:
AppendRow_Click
Case 23:
SetScript_Click
Case 25:
Frozen_Click
End Select
End Sub
- ReportX实例(3)VB
- ReportX实例(1)WEB
- ReportX实例(2).NET
- ReportX技巧(3)ReportX直接连接数据库
- ReportX技巧(5)图表
- ReportX技巧(1)InvalidatePaint()、ValidatePaint()
- ReportX技巧(2)公式、脚本
- ReportX技巧(7)标题行列
- ReportX技巧(8)输入输出EXCEL
- ReportX技巧(9)输入控制
- ReportX技巧(4)用ReportX的脚本功能连接数据库
- VB实例 —万年历 (3)
- asp(vb)实用实例
- ReportX技巧(6)数字、日期、时间格式
- ReportX技巧(10)模板方式读取数据库
- ReportX技巧(11)隐藏打印预览窗口工具栏按钮
- ReportX问答
- ReportX概述
- 日本人骑着22的自行车就上了高速!
- ASP.NET之父Scott Guthrie做客微软北京.NET俱乐部
- 2.C++类this指针
- 在Visual Studio环境中开发PHP项目
- 3.C++类对象
- ReportX实例(3)VB
- 4.C++类作用域
- Ajax--------收发 json 数据
- 5.C++类inline函数
- PXELINUX实现网络安装操作系统
- 学习面向对象开发的方法
- 重大误解:百年极限论使2500年芝诺悖论迎刃而解
- oracle 系统用户权限
- 6.C++类const成员