📄 report.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{2424118D-0CCD-422E-A626-6D4D5B7ACAF8}#8.0#0"; "远望报表.ocx"
Begin VB.Form RePorts
Caption = "报表打印"
ClientHeight = 8370
ClientLeft = 60
ClientTop = 345
ClientWidth = 11775
Icon = "report.frx":0000
LinkTopic = "Form1"
ScaleHeight = 8370
ScaleWidth = 11775
StartUpPosition = 2 '屏幕中心
Begin 远望报表.YwCells EtCell1
Height = 7005
Left = 330
TabIndex = 7
Top = 150
Width = 11355
_ExtentX = 20029
_ExtentY = 12356
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty DefaultFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 2910
Top = 7050
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "打 印"
Height = 1065
Left = 60
TabIndex = 0
Top = 7290
Width = 11685
Begin VB.CommandButton Command1
Caption = "保存报表"
Height = 525
Left = 8250
TabIndex = 6
Top = 300
Width = 1395
End
Begin VB.CommandButton Command2
Caption = "打印"
Height = 525
Left = 4170
TabIndex = 5
Top = 300
Width = 1395
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 525
Left = 6210
TabIndex = 4
Top = 300
Width = 1395
End
Begin VB.CheckBox Chkpage
Caption = "是否打印页码"
Height = 195
Left = 150
TabIndex = 3
Top = 660
Width = 1635
End
Begin VB.OptionButton Option2
Caption = "实际尺寸"
Height = 225
Left = 1530
TabIndex = 2
Top = 270
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "智能调整"
Height = 195
Left = 120
TabIndex = 1
Top = 300
Value = -1 'True
Width = 1125
End
End
End
Attribute VB_Name = "RePorts"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Report_name As String
Public StrRS As String
Public StrRQ1 As String
Public StrRQ2 As String
Public StrCkmc As String
Public StrA As String
Public StrB As String
Public strKztj As String
Dim et As String
Private Sub Command1_Click()
On Error GoTo err1
Dim sjkname As String
CommonDialog1.DialogTitle = "保存报表文件"
CommonDialog1.Filter = "*.xls"
CommonDialog1.ShowSave
sjkname = CommonDialog1.FileName
If Trim(sjkname) = "" Then Exit Sub
If EtCell1.SaveAs(sjkname & ".xls") Then
MsgBox "保存成功!", vbInformation, "报表保存"
Else
MsgBox "报表保存失败!", vbInformation, "报表保存"
End If
Exit Sub
err1:
Exit Sub
End Sub
Private Sub Command2_Click()
''''''''''''''''''''打印
EtCell1.Ruler = False
''自动调整
If Option1.Value = False Then EtCell1.PrintFullPage = False
If Option2.Value = False Then EtCell1.PrintFullPage = True
''是否打印页码
If Chkpage.Value = 1 Then
EtCell1.PrintPageNo = True
Else
EtCell1.PrintPageNo = False
End If
''自动调整行高.列宽
''EtCell1.SetAutoAdjustTable 1
''是否报表只读
EtCell1.ReadOnly = True
''打印浏览
EtCell1.SetPreviewOption 31
EtCell1.PrintPreview
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
EtCell1.Top = 0
EtCell1.Left = 0
EtCell1.Width = Me.Width - 80
EtCell1.Height = Me.Height - 1800
Frame1.Left = 60
Frame1.Width = Me.Width - 220
Frame1.Top = Me.Height - 1600
Frame1.Height = 1065
EtCell1.ReadOnly = True
End Sub
Private Sub Form_Resize()
On Error GoTo err
EtCell1.Top = 0
EtCell1.Left = 0
EtCell1.Width = Me.Width - 80
EtCell1.Height = Me.Height - 1800
Frame1.Left = 60
Frame1.Width = Me.Width - 220
Frame1.Top = Me.Height - 1600
Frame1.Height = 1065
Exit Sub
err:
Exit Sub
End Sub
Private Sub Form_Unload(Cancel As Integer)
EtCell1.CloseFileCell
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -