-
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:28k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form KF_FrmInList 
  5.    Caption         =   "入库汇总表"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   1219006
  11.    Icon            =   "统计分析_入库汇总.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.ImageList ImageList1 
  19.       Left            =   5760
  20.       Top             =   0
  21.       _ExtentX        =   1005
  22.       _ExtentY        =   1005
  23.       BackColor       =   -2147483643
  24.       ImageWidth      =   16
  25.       ImageHeight     =   16
  26.       MaskColor       =   12632256
  27.       _Version        =   393216
  28.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  29.          NumListImages   =   18
  30.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  31.             Picture         =   "统计分析_入库汇总.frx":1042
  32.             Key             =   "sz"
  33.          EndProperty
  34.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  35.             Picture         =   "统计分析_入库汇总.frx":13DC
  36.             Key             =   "dy"
  37.          EndProperty
  38.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  39.             Picture         =   "统计分析_入库汇总.frx":1776
  40.             Key             =   "yl"
  41.          EndProperty
  42.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  43.             Picture         =   "统计分析_入库汇总.frx":1B10
  44.             Key             =   "cx"
  45.          EndProperty
  46.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  47.             Picture         =   "统计分析_入库汇总.frx":1EAA
  48.             Key             =   "dj"
  49.          EndProperty
  50.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  51.             Picture         =   "统计分析_入库汇总.frx":2244
  52.             Key             =   "sx"
  53.          EndProperty
  54.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  55.             Picture         =   "统计分析_入库汇总.frx":25DE
  56.             Key             =   "first"
  57.          EndProperty
  58.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  59.             Picture         =   "统计分析_入库汇总.frx":2978
  60.             Key             =   "prev"
  61.          EndProperty
  62.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  63.             Picture         =   "统计分析_入库汇总.frx":2D12
  64.             Key             =   "next"
  65.          EndProperty
  66.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  67.             Picture         =   "统计分析_入库汇总.frx":30AC
  68.             Key             =   "last"
  69.          EndProperty
  70.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  71.             Picture         =   "统计分析_入库汇总.frx":3446
  72.             Key             =   "bz"
  73.          EndProperty
  74.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  75.             Picture         =   "统计分析_入库汇总.frx":37E0
  76.             Key             =   "tc"
  77.          EndProperty
  78.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  79.             Picture         =   "统计分析_入库汇总.frx":3B7A
  80.             Key             =   "bcgs"
  81.          EndProperty
  82.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  83.             Picture         =   "统计分析_入库汇总.frx":3F14
  84.             Key             =   "mrlk"
  85.          EndProperty
  86.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  87.             Picture         =   "统计分析_入库汇总.frx":42AE
  88.             Key             =   "xsxm"
  89.          EndProperty
  90.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  91.             Picture         =   "统计分析_入库汇总.frx":4648
  92.             Key             =   "xz"
  93.          EndProperty
  94.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  95.             Picture         =   "统计分析_入库汇总.frx":49E2
  96.             Key             =   ""
  97.          EndProperty
  98.          BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  99.             Picture         =   "统计分析_入库汇总.frx":4D7C
  100.             Key             =   "sc"
  101.          EndProperty
  102.       EndProperty
  103.    End
  104.    Begin MSComctlLib.Toolbar GsToolbar 
  105.       Height          =   525
  106.       Left            =   9195
  107.       TabIndex        =   4
  108.       Top             =   30
  109.       Width           =   2595
  110.       _ExtentX        =   4577
  111.       _ExtentY        =   926
  112.       ButtonWidth     =   1455
  113.       ButtonHeight    =   926
  114.       AllowCustomize  =   0   'False
  115.       Appearance      =   1
  116.       Style           =   1
  117.       ImageList       =   "ImageList1"
  118.       _Version        =   393216
  119.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  120.          NumButtons      =   3
  121.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  122.             Caption         =   "保存格式"
  123.             Key             =   "bcgs"
  124.             ImageKey        =   "bcgs"
  125.          EndProperty
  126.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  127.             Caption         =   "默认列宽"
  128.             Key             =   "hfmrgs"
  129.             ImageKey        =   "mrlk"
  130.          EndProperty
  131.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  132.             Caption         =   "显示项目"
  133.             Key             =   "szxsxm"
  134.             ImageKey        =   "xsxm"
  135.          EndProperty
  136.       EndProperty
  137.    End
  138.    Begin VB.PictureBox Pic_Title 
  139.       BackColor       =   &H00FFFFFF&
  140.       Height          =   1065
  141.       Left            =   0
  142.       Picture         =   "统计分析_入库汇总.frx":5116
  143.       ScaleHeight     =   1005
  144.       ScaleWidth      =   11715
  145.       TabIndex        =   2
  146.       Top             =   570
  147.       Width           =   11775
  148.       Begin VB.Label Label1 
  149.          AutoSize        =   -1  'True
  150.          BackStyle       =   0  'Transparent
  151.          Caption         =   "会计期间:"
  152.          Height          =   180
  153.          Left            =   825
  154.          TabIndex        =   5
  155.          Top             =   705
  156.          Width           =   810
  157.       End
  158.       Begin VB.Label tsLabel 
  159.          AutoSize        =   -1  'True
  160.          BackColor       =   &H80000018&
  161.          BackStyle       =   0  'Transparent
  162.          Caption         =   "入库汇总表"
  163.          BeginProperty Font 
  164.             Name            =   "宋体"
  165.             Size            =   14.25
  166.             Charset         =   134
  167.             Weight          =   700
  168.             Underline       =   0   'False
  169.             Italic          =   0   'False
  170.             Strikethrough   =   0   'False
  171.          EndProperty
  172.          ForeColor       =   &H00000000&
  173.          Height          =   285
  174.          Index           =   4
  175.          Left            =   495
  176.          TabIndex        =   3
  177.          Top             =   150
  178.          Width           =   1500
  179.       End
  180.    End
  181.    Begin VB.Timer Timer1 
  182.       Enabled         =   0   'False
  183.       Interval        =   1
  184.       Left            =   7620
  185.       Top             =   90
  186.    End
  187.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  188.       Height          =   6975
  189.       Left            =   0
  190.       TabIndex        =   0
  191.       Top             =   1680
  192.       Width           =   11775
  193.       _cx             =   5080
  194.       _cy             =   5080
  195.       Appearance      =   1
  196.       BorderStyle     =   1
  197.       Enabled         =   -1  'True
  198.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  199.          Name            =   "宋体"
  200.          Size            =   9
  201.          Charset         =   134
  202.          Weight          =   400
  203.          Underline       =   0   'False
  204.          Italic          =   0   'False
  205.          Strikethrough   =   0   'False
  206.       EndProperty
  207.       MousePointer    =   0
  208.       BackColor       =   16777215
  209.       ForeColor       =   -2147483640
  210.       BackColorFixed  =   13826538
  211.       ForeColorFixed  =   -2147483630
  212.       BackColorSel    =   -2147483635
  213.       ForeColorSel    =   -2147483634
  214.       BackColorBkg    =   -2147483636
  215.       BackColorAlternate=   16777215
  216.       GridColor       =   -2147483633
  217.       GridColorFixed  =   -2147483632
  218.       TreeColor       =   -2147483632
  219.       FloodColor      =   192
  220.       SheetBorder     =   -2147483642
  221.       FocusRect       =   1
  222.       HighLight       =   1
  223.       AllowSelection  =   -1  'True
  224.       AllowBigSelection=   -1  'True
  225.       AllowUserResizing=   0
  226.       SelectionMode   =   0
  227.       GridLines       =   1
  228.       GridLinesFixed  =   2
  229.       GridLineWidth   =   1
  230.       Rows            =   50
  231.       Cols            =   10
  232.       FixedRows       =   1
  233.       FixedCols       =   1
  234.       RowHeightMin    =   0
  235.       RowHeightMax    =   0
  236.       ColWidthMin     =   0
  237.       ColWidthMax     =   0
  238.       ExtendLastCol   =   0   'False
  239.       FormatString    =   ""
  240.       ScrollTrack     =   0   'False
  241.       ScrollBars      =   3
  242.       ScrollTips      =   0   'False
  243.       MergeCells      =   0
  244.       MergeCompare    =   0
  245.       AutoResize      =   -1  'True
  246.       AutoSizeMode    =   0
  247.       AutoSearch      =   0
  248.       AutoSearchDelay =   2
  249.       MultiTotals     =   -1  'True
  250.       SubtotalPosition=   1
  251.       OutlineBar      =   0
  252.       OutlineCol      =   0
  253.       Ellipsis        =   0
  254.       ExplorerBar     =   0
  255.       PicturesOver    =   0   'False
  256.       FillStyle       =   0
  257.       RightToLeft     =   0   'False
  258.       PictureType     =   0
  259.       TabBehavior     =   0
  260.       OwnerDraw       =   0
  261.       Editable        =   0
  262.       ShowComboButton =   1
  263.       WordWrap        =   0   'False
  264.       TextStyle       =   0
  265.       TextStyleFixed  =   0
  266.       OleDragMode     =   0
  267.       OleDropMode     =   0
  268.       DataMode        =   0
  269.       VirtualData     =   -1  'True
  270.       DataMember      =   ""
  271.       ComboSearch     =   3
  272.       AutoSizeMouse   =   -1  'True
  273.       FrozenRows      =   0
  274.       FrozenCols      =   0
  275.       AllowUserFreezing=   0
  276.       BackColorFrozen =   0
  277.       ForeColorFrozen =   0
  278.       WallPaperAlignment=   9
  279.       AccessibleName  =   ""
  280.       AccessibleDescription=   ""
  281.       AccessibleValue =   ""
  282.       AccessibleRole  =   24
  283.    End
  284.    Begin MSComctlLib.Toolbar SzToolbar 
  285.       Align           =   1  'Align Top
  286.       Height          =   555
  287.       Left            =   0
  288.       TabIndex        =   1
  289.       Top             =   0
  290.       Width           =   11820
  291.       _ExtentX        =   20849
  292.       _ExtentY        =   979
  293.       ButtonWidth     =   820
  294.       ButtonHeight    =   926
  295.       AllowCustomize  =   0   'False
  296.       Appearance      =   1
  297.       Style           =   1
  298.       ImageList       =   "ImageList1"
  299.       _Version        =   393216
  300.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  301.          NumButtons      =   9
  302.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  303.             Caption         =   "设置"
  304.             Key             =   "ymsz"
  305.             ImageKey        =   "sz"
  306.          EndProperty
  307.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  308.             Caption         =   "打印"
  309.             Key             =   "dy"
  310.             ImageKey        =   "dy"
  311.          EndProperty
  312.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  313.             Caption         =   "预览"
  314.             Key             =   "yl"
  315.             ImageKey        =   "yl"
  316.          EndProperty
  317.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  318.             Style           =   3
  319.          EndProperty
  320.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  321.             Caption         =   "查询"
  322.             Key             =   "cx"
  323.             ImageKey        =   "cx"
  324.          EndProperty
  325.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  326.             Object.Visible         =   0   'False
  327.             Caption         =   "刷新"
  328.             Key             =   "sx"
  329.             ImageKey        =   "sx"
  330.          EndProperty
  331.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  332.             Style           =   3
  333.          EndProperty
  334.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  335.             Caption         =   "帮助"
  336.             Key             =   "bz"
  337.             ImageKey        =   "bz"
  338.          EndProperty
  339.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  340.             Caption         =   "退出"
  341.             Key             =   "fh"
  342.             ImageKey        =   "tc"
  343.          EndProperty
  344.       EndProperty
  345.       BorderStyle     =   1
  346.    End
  347. End
  348. Attribute VB_Name = "KF_FrmInList"
  349. Attribute VB_GlobalNameSpace = False
  350. Attribute VB_Creatable = False
  351. Attribute VB_PredeclaredId = True
  352. Attribute VB_Exposed = False
  353. '**************************************************************************
  354. '*    模 块 名 称 :入库汇总表
  355. '*    功 能 描 述 :
  356. '*    程序员姓名  : 赵宇光
  357. '*    最后修改人  : 赵宇光
  358. '*    最后修改时间:2001/12/18
  359. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  360. '**************************************************************************
  361. Dim ReportTitle As String                '报表主标题
  362. '以下为固定使用变量
  363. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  364. Dim GridCode As String                   '显示网格网格代码
  365. Dim GridInf() As Variant                 '整个网格设置信息
  366. Dim Tsxx As String                       '系统提示信息
  367. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  368. Dim Sjhgd As Double                      '网格数据行高度
  369. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  370. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  371. Dim GridStr()  As String                 '网格列信息(字符型)
  372. Dim GridInt() As Integer                 '网格列信息(整型)
  373. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  374. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  375.     On Error Resume Next
  376.     With CxbbGrid
  377.       .Width = Me.Width - 160
  378.       .Height = Me.Height - .Top - 400
  379.     End With
  380.     With Pic_Title
  381.       .Width = Me.Width - 160
  382.     End With
  383.     
  384.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  385. End Sub
  386. Private Sub Form_Load()                                                   '窗体装入
  387.     
  388.      '调入打印页面设置窗体
  389.      
  390.      XtReportCode = "KF_InList"
  391.      Load Dyymctbl
  392.      ReportTitle = "入库汇总表"
  393.      
  394.     '调整标题栏及网格、格式工具条位置
  395.      Pic_Title.Left = 40
  396.      Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  397.      CxbbGrid.Left = Pic_Title.Left
  398.      CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  399.     
  400.     '调 入 网 格
  401.      GridCode = "KF_InList"
  402.      Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  403.      
  404.      Qslz = GridInf(1)
  405.      Sjhgd = GridInf(2)
  406.      Sfxshjwg = GridInf(7)
  407.      Szzls = CxbbGrid.Cols - 1
  408. End Sub
  409. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  410.    '卸载条件窗体
  411.     KF_FrmInListQuery.UnloadCheck.Value = 1
  412.     Unload KF_FrmInListQuery
  413.    '卸载打印页面设置窗体
  414.    Unload Dyymctbl
  415. End Sub
  416. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  417.     Select Case Button.Key
  418.         Case "bcgs"                                          '保存表格格式
  419.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  420.         Case "hfmrgs"                                        '恢复默认格式
  421.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  422.         Case "szxsxm"                                        '设置显示项目
  423.             Call Szxsxm(CxbbGrid, GridCode)
  424.     End Select
  425. End Sub
  426. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  427.     Select Case Button.Key
  428.         Case "ymsz"                                          '页面设置
  429.             Dyymctbl.Show 1
  430.         Case "yl"                                            '预 览
  431.            Call bbyl(True)
  432.         Case "dy"                                            '打 印
  433.           Call bbyl(False)
  434.         Case "cx"                                            '查 询
  435.           KF_FrmInListQuery.Show 1
  436.         Case "sx"                                            '刷 新
  437.           Call Timer1_Timer
  438.         Case "bz"                                            '帮 助
  439.           Call F1bz
  440.         Case "fh"                                            '退 出
  441.          Unload Me
  442.      End Select
  443. End Sub
  444. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  445.    Timer1.Enabled = False
  446.    Xt_Wait.Show
  447.    Xt_Wait.Refresh
  448.    
  449.    '加快显示速度
  450.    CxbbGrid.Redraw = False
  451.    '生成查询结果
  452.    Call Sub_Query
  453.    
  454.    CxbbGrid.Redraw = True
  455.     
  456.    Xt_Wait.Hide
  457. End Sub
  458. Public Sub Adjust()
  459.     Dim R As New Recordset
  460.     
  461.     Set R = Cw_DataEnvi.DataConnect.Execute("select colindex,coltitle1 from wm_grid where grid_code='kf_stockin_list' order by colid")
  462.     
  463.     If Not R.EOF Then
  464.         R.MoveNext
  465.         For jsq = 0 To CxbbGrid.Cols - 1
  466.             Do While Not R.EOF
  467.                 If Trim(R.Fields("coltitle1")) = Trim(CxbbGrid.TextMatrix(0, jsq)) Then
  468.                     GridStr(jsq, 1) = R.Fields("colindex")
  469.                     Exit Do
  470.                 End If
  471.                 R.MoveNext
  472.             Loop
  473.             R.MoveFirst
  474.             R.MoveNext
  475.         Next jsq
  476.     End If
  477.     R.Close
  478.     Set R = Nothing
  479. End Sub
  480. Private Sub Sub_Query()                                    '生成查询结果
  481.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  482.     Dim Str_QueryCondi As String                '用户录入查询条件
  483.     Dim Sqlstr As String                        '查询字符串
  484.     Dim Coljsq As Long                          '网格列计数器
  485.     Dim jsqte As Long                           '临时动态计数器
  486.     Dim Xtyear As Integer, Period As Integer
  487.     Dim strGroup As String
  488.     Dim dblSumQuan As Double
  489.     Dim dblSumMoney As Double
  490.     Dim tempCol As Integer
  491.     Dim Rec_Mate As New Recordset
  492.     Dim strWhCodeSelect As String
  493.     Dim tmpJsq As Integer
  494.     With KF_FrmInListQuery
  495.     
  496.         '显示隐藏相应网格列
  497.         Select Case .Combo1.ListIndex
  498.             Case 0      '物料
  499.                 Str_QueryCondi = "SELECT SUM(factreceiptquan) AS InQuan,SUM(EMoney) AS InMoney,MNumber,MName,Model,PrimaryUnitName FROM KF_V_InOutList WHERE InOutFlag=1"
  500.                 strGroup = " GROUP BY MNumber,MName,Model,PrimaryUnitName"
  501.                 tempCol = 2
  502.                 CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = True            '供应商
  503.                 CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = True            '部门
  504.             Case 1      '供应商+物料
  505.                 Str_QueryCondi = "SELECT SUM(factreceiptquan) AS InQuan,SUM(EMoney) AS InMoney,MNumber,SupplierCode,SupplierName,MName,Model,PrimaryUnitName FROM KF_V_InOutList WHERE InOutFlag=1 AND SupplierCode IS NOT NULL"
  506.                 strGroup = " GROUP BY SupplierCode,SupplierName,MNumber,MName,Model,PrimaryUnitName"
  507.                 tempCol = 0
  508.                 CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = True
  509.                 CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False            '供应商
  510.             Case 2      '部门+物料
  511.                 Str_QueryCondi = "SELECT SUM(factreceiptquan) AS InQuan,SUM(EMoney) AS InMoney,MNumber,DeptCode,DeptName,MName,Model,PrimaryUnitName FROM KF_V_InOutList WHERE InOutFlag=1 AND DeptCode IS NOT NULL"
  512.                 strGroup = " GROUP BY DeptCode,DeptName,MNumber,MName,Model,PrimaryUnitName"
  513.                 tempCol = 1
  514.                 CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = True
  515.                 CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False            '部门
  516.         End Select
  517.      
  518.         '显示查询会计期间
  519.         For jsqte = 1 To 7
  520.             Select Case jsqte
  521.               
  522.                 Case 1  '会计期间
  523.                     If Trim(.Combo_Kjqj2.Text) <> "" Then
  524.                         Xtyear = Val(Mid(Trim(.Combo_Kjqj2.Text), 1, 4))
  525.                         Period = Val(Mid(Trim(.Combo_Kjqj2.Text), 6))
  526.                         Str_QueryCondi = Str_QueryCondi & " AND kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  527.                     End If
  528.               
  529.                 Case 2   '仓库
  530.                     strWhCodeSelect = ""
  531.                     For tmpJsq = 0 To .Lst_Check.ListCount - 1
  532.                         If .Lst_Check.Selected(tmpJsq) Then
  533.                             strWhCodeSelect = strWhCodeSelect & "'" & Mid(Trim(.Lst_Check.List(tmpJsq)), 1, 4) & "',"
  534.                         End If
  535.                     Next tmpJsq
  536.                     
  537.                     Str_QueryCondi = Str_QueryCondi & " and WhCode in (" & Mid(Trim(strWhCodeSelect), 1, (Len(strWhCodeSelect) - 1)) & ")"
  538.              
  539.                 Case 3   '物料分类
  540.                     If Trim(.LrText(0).Text) <> "" Then
  541.                         Str_QueryCondi = Str_QueryCondi & " and invsortcode LIKE '" & Trim(.LrText(0).Tag) & "%'"
  542.                     End If
  543.                 
  544.                 Case 4   '材料
  545.                     If Trim(.LrText(1).Text) <> "" Then
  546.                         If Trim(.LrText(2).Text) <> "" Then
  547.                             Str_QueryCondi = Str_QueryCondi & " and mnumber between '" & Trim(.LrText(1).Text) & "' and '" & Trim(.LrText(2).Text) & "'"
  548.                         Else
  549.                             Str_QueryCondi = Str_QueryCondi & " and mnumber>='" & Trim(.LrText(1).Text) & "'"
  550.                         End If
  551.                     Else
  552.                        If Trim(.LrText(2).Text) <> "" Then
  553.                           Str_QueryCondi = Str_QueryCondi & " and mnumber<='" & Trim(.LrText(2).Text) & "'"
  554.                        End If
  555.                     End If
  556.                 Case 5   '供应商
  557.                     If Trim(.LrText(3).Text) <> "" Then
  558.                         Str_QueryCondi = Str_QueryCondi & " and  suppliercode='" & Trim(.LrText(3).Tag) & "'"
  559.                     End If
  560.                     
  561.                 Case 6   '部门
  562.                     If Trim(.LrText(4).Text) <> "" Then
  563.                         Str_QueryCondi = Str_QueryCondi & " and  DeptCode='" & Trim(.LrText(4).Tag) & "'"
  564.                     End If
  565.                 Case 7  '日期
  566.                     If Trim(.LrText(5).Text) <> "" Then
  567.                         If Trim(.LrText(6).Text) <> "" Then
  568.                             Str_QueryCondi = Str_QueryCondi & " and billdate between '" & CDate(Trim(.LrText(5).Text)) & "' and '" & CDate(Trim(.LrText(6).Text)) & "'"
  569.                         Else
  570.                             Str_QueryCondi = Str_QueryCondi & " and billdate>='" & CDate(Trim(.LrText(5).Text)) & "'"
  571.                         End If
  572.                     Else
  573.                        If Trim(.LrText(6).Text) <> "" Then
  574.                           Str_QueryCondi = Str_QueryCondi & " and billdate<='" & CDate(Trim(.LrText(6).Text)) & "'"
  575.                        Else
  576.                        End If
  577.                     End If
  578.             End Select
  579.         Next jsqte
  580.     End With
  581.     
  582.     Label1 = "会计期间:   " & Trim(KF_FrmInListQuery.Combo_Kjqj1.Text) & "----" & Trim(KF_FrmInListQuery.Combo_Kjqj2.Text)
  583.     dblSumQuan = 0
  584.     dblSumMoney = 0
  585.     
  586.     Str_QueryCondi = Str_QueryCondi & strGroup
  587.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Str_QueryCondi)
  588.     
  589.     CxbbGrid.Rows = CxbbGrid.FixedRows
  590.     jsqte = CxbbGrid.FixedRows
  591.     With Rec_Query
  592.         If Not .EOF Then
  593.             .MoveFirst
  594.             Do While Not .EOF
  595.                 CxbbGrid.AddItem ""
  596.                 If CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False Then
  597.                     CxbbGrid.TextMatrix(jsqte, Sydz("001", GridStr(), Szzls)) = Trim(.Fields("SupplierName") & "")      '供应商
  598.                 End If
  599.                 If CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False Then
  600.                     CxbbGrid.TextMatrix(jsqte, Sydz("002", GridStr(), Szzls)) = Trim(.Fields("DeptName") & "")          '部门
  601.                 End If
  602.                 CxbbGrid.TextMatrix(jsqte, Sydz("003", GridStr(), Szzls)) = Trim(.Fields("MNumber"))                    '物料编码
  603.                 CxbbGrid.TextMatrix(jsqte, Sydz("004", GridStr(), Szzls)) = Trim(.Fields("MName"))                      '物料名称
  604.                 CxbbGrid.TextMatrix(jsqte, Sydz("005", GridStr(), Szzls)) = Trim(.Fields("Model") & "")                 '规格型号
  605.                 CxbbGrid.TextMatrix(jsqte, Sydz("006", GridStr(), Szzls)) = Trim(.Fields("PrimaryUnitName"))            '计量单位
  606.                 If Val(.Fields("InQuan")) <> 0 Then
  607.                     CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = Val(.Fields("InQuan"))                  '入库数量
  608.                     dblSumQuan = dblSumQuan + Val(.Fields("InQuan"))
  609.                 Else
  610.                     CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = ""
  611.                 End If
  612.                 If Val(.Fields("InMoney")) <> 0 Then
  613.                     CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = Val(.Fields("InMoney"))                 '入库金额
  614.                     dblSumMoney = dblSumMoney + Val(.Fields("InMoney"))
  615.                 Else
  616.                     CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = ""
  617.                 End If
  618.                 
  619.                 CxbbGrid.RowHeight(jsqte) = Sjhgd
  620.                 jsqte = jsqte + 1
  621.                 .MoveNext
  622.             Loop
  623.         End If
  624.     End With
  625.     CxbbGrid.AddItem ""
  626.     CxbbGrid.TextMatrix(jsqte, tempCol) = "合计"
  627.     If dblSumQuan <> 0 Then
  628.         CxbbGrid.TextMatrix(jsqte, Sydz("007", GridStr(), Szzls)) = dblSumQuan                                          '合计数量
  629.     End If
  630.     If dblSumMoney <> 0 Then
  631.         CxbbGrid.TextMatrix(jsqte, Sydz("008", GridStr(), Szzls)) = dblSumMoney                                         '合计金额
  632.     End If
  633.     CxbbGrid.RowHeight(CxbbGrid.Rows - 1) = Sjhgd
  634.  ']以上为用户自定义部分
  635.    
  636. End Sub
  637. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)
  638.     '如果结束列小于用户定义网格开始列,则结束列=用户定义网格开始列
  639.     '因为开始列以前的列都是隐藏列,由于要把当前开始移动列移动到隐藏列上
  640.     '所以控件自动把隐藏列变为显示列,这样在刷新数据时,会把隐藏列上的数据
  641.     '显示出来,并且,由于开始列以前的隐藏列在XT_Grid中,不对应逻辑值,所以在保存
  642.     '网格格式时会出错
  643.     If Col > Position Then
  644.       If Position < GridInf(1) Then Position = GridInf(1)
  645.     Else
  646.       If Col < GridInf(1) Then Col = GridInf(1)
  647.     End If
  648.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  649. End Sub
  650. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  651.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  652.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  653.     Bbxbtgs = 2                                          '报 表 小 标 题 行 数
  654.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  655.     ReDim Bbxbt(1 To Bbxbtgs)
  656.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  657.     If Bbbwhgs <> 0 Then
  658.        ReDim Bbbwh(1 To Bbbwhgs)
  659.        ReDim Bbbwhzzxs(1 To Bbbwhgs)
  660.     End If
  661.     Bbzbt = ReportTitle
  662.     
  663.     Bbxbt(2) = Space(5) + Fun_FormatOutPut(Trim(Label1), 30)
  664.     
  665.     Bbxbt(1) = " "
  666.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  667.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  668.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  669.     If Not bbylte Then
  670.        Unload DY_Tybbyldy
  671.     End If
  672. End Sub