?? mdlreport.bas
字號:
Attribute VB_Name = "mdlReport"
Option Explicit
'***********************************************************************
'* 過程名:DspDayReport
'* 功 能:日報查詢顯示
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Public Sub DspDayReport(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date)
'變量定義
Dim dayReport As clsDayReport
Dim dayReportItem As clsDayReportItem
Dim curListItem As ListItem
'取得日報
Set dayReport = New clsDayReport
dayReport.LoadSet shopId, saledate
'清除現有顯示
lvListViewCtl.ColumnHeaders.Clear
lvListViewCtl.ListItems.Clear
'設定表頭
lvListViewCtl.ColumnHeaders.Add , "日期", "日期"
lvListViewCtl.ColumnHeaders.Add , "店名", "店名"
lvListViewCtl.ColumnHeaders.Add , "商品", "商品"
lvListViewCtl.ColumnHeaders.Add , "類別", "類別"
lvListViewCtl.ColumnHeaders.Add , "銷量", "銷量"
For Each dayReportItem In dayReport
Set curListItem = lvListViewCtl.ListItems.Add(, , CStr(dayReportItem.saledate))
curListItem.SubItems(1) = dayReportItem.shopName
curListItem.SubItems(2) = dayReportItem.merchandiseName
curListItem.SubItems(3) = dayReportItem.kindName
curListItem.SubItems(4) = CStr(dayReportItem.merchandiseCount)
Next
g_listViewState = REPORTDAY
End Sub
'***********************************************************************
'* 過程名:PrePrintDayReport
'* 功 能:日報預覽顯示
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Public Sub PrePrintDayReport(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date)
DayReportCommSub lvListViewCtl, shopId, saledate, False
End Sub
'***********************************************************************
'* 過程名:PrintDayReport
'* 功 能:日報打印
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Public Sub PrintDayReport(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date)
DayReportCommSub lvListViewCtl, shopId, saledate, True
End Sub
'***********************************************************************
'* 過程名:DayReportCommSub
'* 功 能:日報預覽顯示/打印
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* :Boolean 打印標志
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Private Sub DayReportCommSub(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date, _
ByVal printFlag As Boolean)
'顯示列表
DspDayReport lvListViewCtl, shopId, saledate
Dim report As arDayReport
Set report = New arDayReport
'報表數據設定
'日期
report.g_reportDate = CStr(saledate)
'店名
Dim shop As clsMembershop
Set shop = New clsMembershop
shop.LoadByShopId shopId
report.g_shopName = shop.shopName
'日報數據
Dim dayReport As clsDayReport
Set dayReport = New clsDayReport
dayReport.LoadSet shopId, saledate
Set report.g_dayReport = dayReport
If printFlag Then '打印報表
report.PrintReport True
Else '顯示報表
report.Show vbModal
End If
End Sub
'***********************************************************************
'* 過程名:DspMonReport
'* 功 能:月報查詢顯示
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Public Sub DspMonReport(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date)
'變量定義
Dim monReport As clsMonReport
Dim monReportItem As clsMonReportItem
Dim curListItem As ListItem
'取得月報
Set monReport = New clsMonReport
monReport.LoadSet shopId, saledate
'清除現有顯示
lvListViewCtl.ColumnHeaders.Clear
lvListViewCtl.ListItems.Clear
'設定表頭
lvListViewCtl.ColumnHeaders.Add , "日期", "日期"
lvListViewCtl.ColumnHeaders.Add , "店名", "店名"
lvListViewCtl.ColumnHeaders.Add , "商品", "商品"
lvListViewCtl.ColumnHeaders.Add , "類別", "類別"
lvListViewCtl.ColumnHeaders.Add , "銷量", "銷量"
For Each monReportItem In monReport
Set curListItem = lvListViewCtl.ListItems.Add(, , _
CStr(DatePart("yyyy", monReportItem.saledate)) & "-" & _
CStr(DatePart("m", monReportItem.saledate)))
curListItem.SubItems(1) = monReportItem.shopName
curListItem.SubItems(2) = monReportItem.merchandiseName
curListItem.SubItems(3) = monReportItem.kindName
curListItem.SubItems(4) = CStr(monReportItem.merchandiseCount)
Next
g_listViewState = REPORTMON
End Sub
'***********************************************************************
'* 過程名:PrePrintMonReport
'* 功 能:月報預覽顯示
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Public Sub PrePrintMonReport(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date)
MonReportCommSub lvListViewCtl, shopId, saledate, False
End Sub
'***********************************************************************
'* 過程名:PrintMonReport
'* 功 能:月報打印
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Public Sub PrintMonReport(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date)
MonReportCommSub lvListViewCtl, shopId, saledate, True
End Sub
'***********************************************************************
'* 過程名:MonReportCommSub
'* 功 能:月報預覽顯示/打印
'* 參 數:ListView 列表控件
'* :Integer 店ID
'* :Date 日期
'* :Boolean 打印標志
'* 版 本:2006.01.06 顏志軍 初版
'***********************************************************************
Private Sub MonReportCommSub(ByRef lvListViewCtl As ListView, _
ByVal shopId As Integer, _
ByVal saledate As Date, _
ByVal printFlag As Boolean)
'顯示列表
DspMonReport lvListViewCtl, shopId, saledate
Dim report As arMonReport
Set report = New arMonReport
'報表數據設定
'日期
report.g_reportDate = CStr(DatePart("yyyy", saledate)) & "-" & _
CStr(DatePart("m", saledate))
'店名
Dim shop As clsMembershop
Set shop = New clsMembershop
shop.LoadByShopId shopId
report.g_shopName = shop.shopName
'日報數據
Dim monReport As clsMonReport
Set monReport = New clsMonReport
monReport.LoadSet shopId, saledate
Set report.g_MonReport = monReport
If printFlag Then '打印報表
report.PrintReport True
Else '顯示報表
report.Show vbModal
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -