📄 frmreport.frm
字号:
Width = 4455
Begin MSComCtl2.DTPicker DTSalesEnd
Height = 375
Left = 2760
TabIndex = 3
Top = 480
Width = 1305
_ExtentX = 2302
_ExtentY = 661
_Version = 393216
Format = 24510465
CurrentDate = 37310
End
Begin MSComCtl2.DTPicker DTSalesStart
Height = 375
Left = 840
TabIndex = 2
Top = 480
Width = 1305
_ExtentX = 2302
_ExtentY = 661
_Version = 393216
Format = 24510465
CurrentDate = 37310
End
Begin VB.Label Label2
Caption = "To"
Height = 255
Left = 2400
TabIndex = 35
Top = 480
Width = 255
End
Begin VB.Label Label1
Caption = "From"
Height = 255
Left = 240
TabIndex = 34
Top = 480
Width = 615
End
End
Begin VB.CommandButton cmdFlexSalesToExcel
Caption = "&Flexgrid To Excel"
Height = 375
Left = 6720
TabIndex = 8
Top = 960
Width = 2040
End
Begin VB.CommandButton cmdGenerateReport
Caption = "&Generate Report"
Height = 375
Left = 4680
TabIndex = 7
Top = 960
Width = 2045
End
Begin VB.Label lblTotalSales
Caption = "Total Sales:"
Height = 255
Left = 7945
TabIndex = 36
Top = 360
Width = 855
End
End
Begin MSFlexGridLib.MSFlexGrid FlexSales
Height = 4215
Left = 240
TabIndex = 1
Top = 600
Width = 10935
_ExtentX = 19288
_ExtentY = 7435
_Version = 393216
Cols = 8
AllowUserResizing= 3
End
Begin VB.Label lblFlexSalesCaption
AutoSize = -1 'True
Caption = "From :"
Height = 195
Left = 240
TabIndex = 31
Top = 340
Width = 435
End
End
Begin MSComctlLib.TabStrip TabStrip1
Height = 6855
Left = 0
TabIndex = 0
Top = 0
Width = 11655
_ExtentX = 20558
_ExtentY = 12091
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 3
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "&Rental Sales"
Key = "Income"
Object.ToolTipText = "Income"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "&Movie Statistics"
Key = "Movie Statistics"
Object.ToolTipText = "Movie Statistics"
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "&List of Items to be Returned Today"
Key = "LIRT"
Object.ToolTipText = "List of Items to be Returned Today"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmReport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub chkActor_Click()
If chkActor.Value = 1 Then
cboActor.Enabled = True
chkGenre.Value = False
chkItemCode.Value = False
Else
cboActor.Enabled = False
End If
End Sub
Private Sub chkFilterByCashier_Click()
If chkFilterByCashier.Value = 1 Then
cboCashier.Enabled = True
Else
cboCashier.Enabled = False
End If
End Sub
Private Sub chkGenre_Click()
If chkGenre.Value = 1 Then
cboGenre.Enabled = True
chkItemCode.Value = False
chkActor.Value = False
Else
cboGenre.Enabled = False
End If
End Sub
Private Sub chkItemCode_Click()
If chkItemCode.Value = 1 Then
cboItemCode.Enabled = True
chkGenre.Value = False
chkActor.Value = False
Else
cboItemCode.Enabled = False
End If
End Sub
Private Sub cmdFlexSalesToExcel_Click()
If Trim(FlexSales.TextMatrix(1, 0)) = "" Then
FlexSales.SetFocus
Exit Sub
End If
MousePointer = vbHourglass
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
Call vr_engine.CopyFlexDataToExcel(FlexSales)
MousePointer = vbDefault
End Sub
Private Sub cmdFlexToExcel_Click()
MousePointer = vbHourglass
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
Call vr_engine.CopyFlexDataToExcel(FlexListOfItemsToBEReturnedToday)
MousePointer = vbDefault
FlexListOfItemsToBEReturnedToday.SetFocus
End Sub
Private Sub cmdGenerateReport_Click()
MousePointer = vbHourglass
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
'START SQL
Dim mySQL As String
mySQL = "SELECT * FROM [Transaction] WHERE (Date >= #" & DTSalesStart.Value & "# AND Date <= #" & DTSalesEnd.Value & "#) ORDER BY Date"
If chkFilterByCashier.Value = 1 And Trim(cboCashier.Text) <> "" Then
mySQL = "SELECT * FROM [Transaction] WHERE Cashier = '" & cboCashier.Text & "' AND (Date >= #" & DTSalesStart.Value & "# AND Date <= #" & DTSalesEnd.Value & "#)ORDER BY Date"
End If
'End SQL
Call vr_engine.Report_GetSalesDetailed(FlexSales, mySQL)
Call FlexSales_TotalSales
FlexSales.SetFocus
MousePointer = vbDefault
End Sub
Private Sub cmdGenerateStat_Click()
MousePointer = vbHourglass
Dim vr_engine As VRENTAL_ENGINE
Set vr_engine = New VRENTAL_ENGINE
Dim mySQL As String
' START SQL
mySQL = "SELECT DISTINCT Title FROM [CD TAPES TABLE] "
If chkGenre.Value = 1 Then
mySQL = "SELECT DISTINCT Title FROM [CD TAPES TABLE] WHERE Genre = '" & cboGenre.Text & "'"
End If
If chkItemCode.Value = 1 Then
mySQL = "SELECT Title FROM [CD TAPES TABLE] WHERE [Item Code] = '" & cboItemCode.Text & "'"
''MsgBox Trim(Mid(mySQL, 42, 11)) 'Detect [Item Code]
''MsgBox Trim(Mid(mySQL, 57, Len(mySQL) - 57)) 'Detect [Item Code] value
End If
If chkActor.Value = 1 Then
mySQL = "SELECT Title FROM [CD TAPES TABLE] WHERE Actor = '" & vr_engine.ReplaceString(cboActor.Text, "'", "''") & "'"
End If
' END SQL
Call vr_engine.REPORT_GETMOVIESTAT(FlexMovie, DTPickerStart, DTPickerEnd, optDescending, mySQL)
FlexMovie.SetFocus
MousePointer = vbDefault
End Sub
Private Sub cmdPrint_Click()
'--------------------------------------------
If Trim(FlexMovie.TextMatrix(1, 0)) = "" Then
FlexMovie.SetFocus
Exit Sub
End If
'--------------------------------------------
'--------------------------------------------
If MsgBox("Please insert 8 1/2"" by 13"" paper. ", vbOKCancel, "Insert Paper ") = vbCancel Then
FlexMovie.SetFocus
Exit Sub
End If
'--------------------------------------------
MousePointer = vbHourglass
Printer.Font = "Sans Serif"
Printer.PaperSize = vbPRPSLegal ' 8.5 by 14 inc
Printer.FontSize = 12
Printer.Orientation = 1 'Portrait
Dim LeftMargin, PageCount, BlankLines As Integer
Dim loop1, loop2, Lines, Flag As Long
LeftMargin = 10
Lines = FlexMovie.Rows - 1
If Lines Mod 55 = 0 Then
PageCount = Lines / 55
Else
PageCount = Int(Lines / 55) + 1
End If
'START - HEADING
Printer.Print ""
Printer.Print ""
Printer.Print ""
Printer.Print Tab(LeftMargin); "MOVIE STATISTICS FROM " & UCase(Format(DTPickerStart.Value, "mmm. dd, yyyy")) & " TO " & UCase(Format(DTPickerEnd, "mmm. dd, yyyy"))
Printer.Print ""
Printer.Print Tab(LeftMargin); "No."; Tab(LeftMargin + 9); "TITLE"; Tab(LeftMargin + 45); "FREQUENCY"
Printer.Print Tab(LeftMargin); "======"; Tab(LeftMargin + 9); "=========================="; Tab(LeftMargin + 45); "=========="
'END - HEADING
For loop1 = 1 To PageCount
For loop2 = 1 To 55
Flag = Flag + 1
Printer.Print Tab(LeftMargin); FlexMovie.TextMatrix(Flag, 0); Tab(LeftMargin + 9); FlexMovie.TextMatrix(Flag, 1); Tab(LeftMargin + 45); FlexMovie.TextMatrix(Flag, 2)
If Flag = Lines Then
If Lines Mod 55 > 0 Then
For BlankLines = (Lines Mod 55) To 55
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -