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

企业管理

开发平台:

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_FrmOptypeSum 
  5.    Caption         =   "业务类型汇总表"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   1219002
  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.Toolbar GsToolbar 
  19.       Height          =   525
  20.       Left            =   9330
  21.       TabIndex        =   3
  22.       Top             =   30
  23.       Width           =   2475
  24.       _ExtentX        =   4366
  25.       _ExtentY        =   926
  26.       ButtonWidth     =   1455
  27.       ButtonHeight    =   926
  28.       Appearance      =   1
  29.       Style           =   1
  30.       ImageList       =   "ImageList2"
  31.       _Version        =   393216
  32.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  33.          NumButtons      =   3
  34.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  35.             Caption         =   "保存格式"
  36.             Key             =   "bcgs"
  37.             ImageKey        =   "bcgs"
  38.          EndProperty
  39.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  40.             Caption         =   "默认列宽"
  41.             Key             =   "hfmrgs"
  42.             ImageKey        =   "mrlk"
  43.          EndProperty
  44.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  45.             Caption         =   "显示项目"
  46.             Key             =   "szxsxm"
  47.             ImageKey        =   "xsxm"
  48.          EndProperty
  49.       EndProperty
  50.    End
  51.    Begin VB.PictureBox Pic_Title 
  52.       BackColor       =   &H00FFFFFF&
  53.       Height          =   1050
  54.       Left            =   0
  55.       Picture         =   "统计分析_业务类型汇总.frx":1042
  56.       ScaleHeight     =   990
  57.       ScaleWidth      =   11715
  58.       TabIndex        =   1
  59.       Top             =   570
  60.       Width           =   11775
  61.       Begin VB.Label Label1 
  62.          AutoSize        =   -1  'True
  63.          BackStyle       =   0  'Transparent
  64.          Caption         =   "仓库名称:"
  65.          Height          =   195
  66.          Left            =   3450
  67.          TabIndex        =   6
  68.          Top             =   720
  69.          Width           =   765
  70.       End
  71.       Begin VB.Label Label2 
  72.          AutoSize        =   -1  'True
  73.          BackStyle       =   0  'Transparent
  74.          Caption         =   "日期范围:"
  75.          Height          =   195
  76.          Left            =   8340
  77.          TabIndex        =   5
  78.          Top             =   735
  79.          Width           =   765
  80.       End
  81.       Begin VB.Label Label3 
  82.          AutoSize        =   -1  'True
  83.          BackStyle       =   0  'Transparent
  84.          Caption         =   "仓库编码:"
  85.          Height          =   195
  86.          Left            =   675
  87.          TabIndex        =   4
  88.          Top             =   720
  89.          Width           =   765
  90.       End
  91.       Begin VB.Label Lab_Title 
  92.          BackColor       =   &H80000018&
  93.          BackStyle       =   0  'Transparent
  94.          Caption         =   "业务类型汇总表"
  95.          BeginProperty Font 
  96.             Name            =   "宋体"
  97.             Size            =   12
  98.             Charset         =   134
  99.             Weight          =   700
  100.             Underline       =   0   'False
  101.             Italic          =   0   'False
  102.             Strikethrough   =   0   'False
  103.          EndProperty
  104.          ForeColor       =   &H00000000&
  105.          Height          =   300
  106.          Index           =   4
  107.          Left            =   480
  108.          TabIndex        =   2
  109.          Top             =   210
  110.          Width           =   2715
  111.       End
  112.    End
  113.    Begin VB.Timer Timer1 
  114.       Enabled         =   0   'False
  115.       Interval        =   1
  116.       Left            =   7620
  117.       Top             =   90
  118.    End
  119.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  120.       Height          =   7365
  121.       Left            =   0
  122.       TabIndex        =   0
  123.       Top             =   1650
  124.       Width           =   11775
  125.       _cx             =   5080
  126.       _cy             =   5080
  127.       Appearance      =   1
  128.       BorderStyle     =   1
  129.       Enabled         =   -1  'True
  130.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  131.          Name            =   "宋体"
  132.          Size            =   9
  133.          Charset         =   134
  134.          Weight          =   400
  135.          Underline       =   0   'False
  136.          Italic          =   0   'False
  137.          Strikethrough   =   0   'False
  138.       EndProperty
  139.       MousePointer    =   0
  140.       BackColor       =   16777215
  141.       ForeColor       =   -2147483640
  142.       BackColorFixed  =   13826538
  143.       ForeColorFixed  =   -2147483630
  144.       BackColorSel    =   -2147483635
  145.       ForeColorSel    =   -2147483634
  146.       BackColorBkg    =   -2147483636
  147.       BackColorAlternate=   16777215
  148.       GridColor       =   -2147483633
  149.       GridColorFixed  =   -2147483632
  150.       TreeColor       =   -2147483632
  151.       FloodColor      =   192
  152.       SheetBorder     =   -2147483642
  153.       FocusRect       =   1
  154.       HighLight       =   1
  155.       AllowSelection  =   -1  'True
  156.       AllowBigSelection=   -1  'True
  157.       AllowUserResizing=   0
  158.       SelectionMode   =   0
  159.       GridLines       =   1
  160.       GridLinesFixed  =   2
  161.       GridLineWidth   =   1
  162.       Rows            =   50
  163.       Cols            =   10
  164.       FixedRows       =   1
  165.       FixedCols       =   1
  166.       RowHeightMin    =   0
  167.       RowHeightMax    =   0
  168.       ColWidthMin     =   0
  169.       ColWidthMax     =   0
  170.       ExtendLastCol   =   0   'False
  171.       FormatString    =   ""
  172.       ScrollTrack     =   0   'False
  173.       ScrollBars      =   3
  174.       ScrollTips      =   0   'False
  175.       MergeCells      =   0
  176.       MergeCompare    =   0
  177.       AutoResize      =   -1  'True
  178.       AutoSizeMode    =   0
  179.       AutoSearch      =   0
  180.       AutoSearchDelay =   2
  181.       MultiTotals     =   -1  'True
  182.       SubtotalPosition=   1
  183.       OutlineBar      =   0
  184.       OutlineCol      =   0
  185.       Ellipsis        =   0
  186.       ExplorerBar     =   0
  187.       PicturesOver    =   0   'False
  188.       FillStyle       =   0
  189.       RightToLeft     =   0   'False
  190.       PictureType     =   0
  191.       TabBehavior     =   0
  192.       OwnerDraw       =   0
  193.       Editable        =   0
  194.       ShowComboButton =   1
  195.       WordWrap        =   0   'False
  196.       TextStyle       =   0
  197.       TextStyleFixed  =   0
  198.       OleDragMode     =   0
  199.       OleDropMode     =   0
  200.       DataMode        =   0
  201.       VirtualData     =   -1  'True
  202.       DataMember      =   ""
  203.       ComboSearch     =   3
  204.       AutoSizeMouse   =   -1  'True
  205.       FrozenRows      =   0
  206.       FrozenCols      =   0
  207.       AllowUserFreezing=   0
  208.       BackColorFrozen =   0
  209.       ForeColorFrozen =   0
  210.       WallPaperAlignment=   9
  211.       AccessibleName  =   ""
  212.       AccessibleDescription=   ""
  213.       AccessibleValue =   ""
  214.       AccessibleRole  =   24
  215.       Begin MSComctlLib.ImageList ImageList2 
  216.          Left            =   0
  217.          Top             =   0
  218.          _ExtentX        =   1005
  219.          _ExtentY        =   1005
  220.          BackColor       =   -2147483643
  221.          ImageWidth      =   16
  222.          ImageHeight     =   16
  223.          MaskColor       =   12632256
  224.          _Version        =   393216
  225.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  226.             NumListImages   =   40
  227.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  228.                Picture         =   "统计分析_业务类型汇总.frx":1FAC4
  229.                Key             =   "sz"
  230.             EndProperty
  231.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  232.                Picture         =   "统计分析_业务类型汇总.frx":1FE5E
  233.                Key             =   "dy"
  234.             EndProperty
  235.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  236.                Picture         =   "统计分析_业务类型汇总.frx":201F8
  237.                Key             =   "yl"
  238.             EndProperty
  239.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  240.                Picture         =   "统计分析_业务类型汇总.frx":20592
  241.                Key             =   "xg"
  242.             EndProperty
  243.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  244.                Picture         =   "统计分析_业务类型汇总.frx":2092C
  245.                Key             =   "zh"
  246.             EndProperty
  247.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  248.                Picture         =   "统计分析_业务类型汇总.frx":20CC6
  249.                Key             =   "sh"
  250.             EndProperty
  251.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  252.                Picture         =   "统计分析_业务类型汇总.frx":21060
  253.                Key             =   "bc"
  254.             EndProperty
  255.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  256.                Picture         =   "统计分析_业务类型汇总.frx":213FA
  257.                Key             =   "fq"
  258.             EndProperty
  259.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  260.                Picture         =   "统计分析_业务类型汇总.frx":21794
  261.                Key             =   "bz"
  262.             EndProperty
  263.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  264.                Picture         =   "统计分析_业务类型汇总.frx":21B2E
  265.                Key             =   "tc"
  266.             EndProperty
  267.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  268.                Picture         =   "统计分析_业务类型汇总.frx":21EC8
  269.                Key             =   "bcgs"
  270.             EndProperty
  271.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  272.                Picture         =   "统计分析_业务类型汇总.frx":22262
  273.                Key             =   "mrlk"
  274.             EndProperty
  275.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  276.                Picture         =   "统计分析_业务类型汇总.frx":225FC
  277.                Key             =   "xsxm"
  278.             EndProperty
  279.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  280.                Picture         =   "统计分析_业务类型汇总.frx":22996
  281.                Key             =   "first"
  282.             EndProperty
  283.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  284.                Picture         =   "统计分析_业务类型汇总.frx":22D30
  285.                Key             =   "prev"
  286.             EndProperty
  287.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  288.                Picture         =   "统计分析_业务类型汇总.frx":230CA
  289.                Key             =   "next"
  290.             EndProperty
  291.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  292.                Picture         =   "统计分析_业务类型汇总.frx":23464
  293.                Key             =   "last"
  294.             EndProperty
  295.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  296.                Picture         =   "统计分析_业务类型汇总.frx":237FE
  297.                Key             =   "xx"
  298.             EndProperty
  299.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  300.                Picture         =   "统计分析_业务类型汇总.frx":23B98
  301.                Key             =   "define"
  302.             EndProperty
  303.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  304.                Picture         =   "统计分析_业务类型汇总.frx":23F32
  305.                Key             =   "exec"
  306.             EndProperty
  307.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  308.                Picture         =   "统计分析_业务类型汇总.frx":242CC
  309.                Key             =   "xz"
  310.             EndProperty
  311.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  312.                Picture         =   "统计分析_业务类型汇总.frx":24666
  313.                Key             =   "sc"
  314.             EndProperty
  315.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  316.                Picture         =   "统计分析_业务类型汇总.frx":24A00
  317.                Key             =   "sx"
  318.             EndProperty
  319.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  320.                Picture         =   "统计分析_业务类型汇总.frx":24D9A
  321.                Key             =   "cx"
  322.             EndProperty
  323.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  324.                Picture         =   "统计分析_业务类型汇总.frx":25134
  325.                Key             =   "zd"
  326.             EndProperty
  327.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  328.                Picture         =   "统计分析_业务类型汇总.frx":254CE
  329.                Key             =   "dz"
  330.             EndProperty
  331.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  332.                Picture         =   "统计分析_业务类型汇总.frx":25868
  333.                Key             =   "ph"
  334.             EndProperty
  335.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  336.                Picture         =   "统计分析_业务类型汇总.frx":25C02
  337.                Key             =   "fz"
  338.             EndProperty
  339.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  340.                Picture         =   "统计分析_业务类型汇总.frx":25F9C
  341.                Key             =   "dw"
  342.             EndProperty
  343.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  344.                Picture         =   "统计分析_业务类型汇总.frx":26336
  345.                Key             =   "hf"
  346.             EndProperty
  347.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  348.                Picture         =   "统计分析_业务类型汇总.frx":266D0
  349.                Key             =   "pz"
  350.             EndProperty
  351.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  352.                Picture         =   "统计分析_业务类型汇总.frx":26A6A
  353.                Key             =   "check"
  354.             EndProperty
  355.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  356.                Picture         =   "统计分析_业务类型汇总.frx":26E04
  357.                Key             =   "qs"
  358.             EndProperty
  359.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  360.                Picture         =   "统计分析_业务类型汇总.frx":2719E
  361.                Key             =   "fullcheck"
  362.             EndProperty
  363.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  364.                Picture         =   "统计分析_业务类型汇总.frx":27538
  365.                Key             =   "qq"
  366.             EndProperty
  367.             BeginProperty ListImage36 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  368.                Picture         =   "统计分析_业务类型汇总.frx":278D2
  369.                Key             =   "bcw"
  370.             EndProperty
  371.             BeginProperty ListImage37 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  372.                Picture         =   "统计分析_业务类型汇总.frx":27C6C
  373.                Key             =   "ye"
  374.             EndProperty
  375.             BeginProperty ListImage38 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  376.                Picture         =   "统计分析_业务类型汇总.frx":28006
  377.                Key             =   ""
  378.             EndProperty
  379.             BeginProperty ListImage39 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  380.                Picture         =   "统计分析_业务类型汇总.frx":283A0
  381.                Key             =   "frist"
  382.             EndProperty
  383.             BeginProperty ListImage40 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  384.                Picture         =   "统计分析_业务类型汇总.frx":2873A
  385.                Key             =   "dj"
  386.             EndProperty
  387.          EndProperty
  388.       End
  389.    End
  390.    Begin MSComctlLib.ImageList ImageList1 
  391.       Left            =   7110
  392.       Top             =   0
  393.       _ExtentX        =   1005
  394.       _ExtentY        =   1005
  395.       BackColor       =   -2147483643
  396.       ImageWidth      =   16
  397.       ImageHeight     =   16
  398.       MaskColor       =   12632256
  399.       _Version        =   393216
  400.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  401.          NumListImages   =   17
  402.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  403.             Picture         =   "统计分析_业务类型汇总.frx":28AD4
  404.             Key             =   "sz"
  405.          EndProperty
  406.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  407.             Picture         =   "统计分析_业务类型汇总.frx":28E6E
  408.             Key             =   "dy"
  409.          EndProperty
  410.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  411.             Picture         =   "统计分析_业务类型汇总.frx":29208
  412.             Key             =   "yl"
  413.          EndProperty
  414.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  415.             Picture         =   "统计分析_业务类型汇总.frx":295A2
  416.             Key             =   "cx"
  417.          EndProperty
  418.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  419.             Picture         =   "统计分析_业务类型汇总.frx":2993C
  420.             Key             =   "dj"
  421.          EndProperty
  422.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  423.             Picture         =   "统计分析_业务类型汇总.frx":29CD6
  424.             Key             =   "sx"
  425.          EndProperty
  426.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  427.             Picture         =   "统计分析_业务类型汇总.frx":2A070
  428.             Key             =   "first"
  429.          EndProperty
  430.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  431.             Picture         =   "统计分析_业务类型汇总.frx":2A40A
  432.             Key             =   "prev"
  433.          EndProperty
  434.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  435.             Picture         =   "统计分析_业务类型汇总.frx":2A7A4
  436.             Key             =   "next"
  437.          EndProperty
  438.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  439.             Picture         =   "统计分析_业务类型汇总.frx":2AB3E
  440.             Key             =   "last"
  441.          EndProperty
  442.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  443.             Picture         =   "统计分析_业务类型汇总.frx":2AED8
  444.             Key             =   "bz"
  445.          EndProperty
  446.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  447.             Picture         =   "统计分析_业务类型汇总.frx":2B272
  448.             Key             =   "tc"
  449.          EndProperty
  450.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  451.             Picture         =   "统计分析_业务类型汇总.frx":2B60C
  452.             Key             =   "bcgs"
  453.          EndProperty
  454.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  455.             Picture         =   "统计分析_业务类型汇总.frx":2B9A6
  456.             Key             =   "mrlk"
  457.          EndProperty
  458.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  459.             Picture         =   "统计分析_业务类型汇总.frx":2BD40
  460.             Key             =   "xsxm"
  461.          EndProperty
  462.          BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  463.             Picture         =   "统计分析_业务类型汇总.frx":2C0DA
  464.             Key             =   "mx"
  465.          EndProperty
  466.          BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  467.             Picture         =   "统计分析_业务类型汇总.frx":2C474
  468.             Key             =   "hz"
  469.          EndProperty
  470.       EndProperty
  471.    End
  472.    Begin MSComctlLib.Toolbar SzToolbar 
  473.       Align           =   1  'Align Top
  474.       Height          =   555
  475.       Left            =   0
  476.       TabIndex        =   7
  477.       Top             =   0
  478.       Width           =   11820
  479.       _ExtentX        =   20849
  480.       _ExtentY        =   979
  481.       ButtonWidth     =   820
  482.       ButtonHeight    =   926
  483.       AllowCustomize  =   0   'False
  484.       Appearance      =   1
  485.       Style           =   1
  486.       ImageList       =   "ImageList1"
  487.       _Version        =   393216
  488.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  489.          NumButtons      =   17
  490.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  491.             Caption         =   "设置"
  492.             Key             =   "ymsz"
  493.             ImageKey        =   "sz"
  494.          EndProperty
  495.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  496.             Caption         =   "打印"
  497.             Key             =   "dy"
  498.             ImageKey        =   "dy"
  499.          EndProperty
  500.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  501.             Caption         =   "预览"
  502.             Key             =   "yl"
  503.             ImageKey        =   "yl"
  504.          EndProperty
  505.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  506.             Style           =   3
  507.          EndProperty
  508.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  509.             Caption         =   "查询"
  510.             Key             =   "cx"
  511.             ImageKey        =   "cx"
  512.          EndProperty
  513.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  514.             Object.Visible         =   0   'False
  515.             Caption         =   "刷新"
  516.             Key             =   "sx"
  517.             ImageKey        =   "sx"
  518.          EndProperty
  519.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  520.             Style           =   3
  521.          EndProperty
  522.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  523.             Caption         =   "汇总"
  524.             Key             =   "Sum"
  525.             ImageKey        =   "hz"
  526.          EndProperty
  527.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  528.             Enabled         =   0   'False
  529.             Caption         =   "明细"
  530.             Key             =   "List"
  531.             ImageKey        =   "mx"
  532.          EndProperty
  533.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  534.             Style           =   3
  535.          EndProperty
  536.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  537.             Caption         =   "首张"
  538.             Key             =   "first"
  539.             ImageKey        =   "first"
  540.          EndProperty
  541.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  542.             Caption         =   "上张"
  543.             Key             =   "prev"
  544.             ImageKey        =   "prev"
  545.          EndProperty
  546.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  547.             Caption         =   "下张"
  548.             Key             =   "next"
  549.             ImageKey        =   "next"
  550.          EndProperty
  551.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  552.             Caption         =   "末张"
  553.             Key             =   "last"
  554.             ImageKey        =   "last"
  555.          EndProperty
  556.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  557.             Style           =   3
  558.          EndProperty
  559.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  560.             Caption         =   "帮助"
  561.             Key             =   "bz"
  562.             ImageKey        =   "bz"
  563.          EndProperty
  564.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  565.             Caption         =   "退出"
  566.             Key             =   "fh"
  567.             ImageKey        =   "tc"
  568.          EndProperty
  569.       EndProperty
  570.       BorderStyle     =   1
  571.    End
  572. End
  573. Attribute VB_Name = "KF_FrmOptypeSum"
  574. Attribute VB_GlobalNameSpace = False
  575. Attribute VB_Creatable = False
  576. Attribute VB_PredeclaredId = True
  577. Attribute VB_Exposed = False
  578. '**************************************************************************
  579. '*    模 块 名 称 :收发类别汇总
  580. '*    功 能 描 述 :
  581. '*    程序员姓名  :赵宇光
  582. '*    最后修改人  :张万成
  583. '*    最后修改时间:2001/12/13
  584. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  585. '**************************************************************************
  586. Dim ReportTitle As String                '报表主标题
  587. '以下为固定使用变量
  588. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  589. Dim GridCode As String                   '显示网格网格代码
  590. Dim GridInf() As Variant                 '整个网格设置信息
  591. Dim Tsxx As String                       '系统提示信息
  592. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  593. Dim Sjhgd As Double                      '网格数据行高度
  594. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  595. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  596. Dim GridStr()  As String                 '网格列信息(字符型)
  597. Dim GridInt() As Integer                 '网格列信息(整型)
  598. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  599. Dim Xtyear As Integer, Period As Integer
  600. Dim Rec_WH As New Recordset
  601. Dim Str_Class1 As String
  602. Dim Str_Class2 As String
  603. Dim Str_Mate As String
  604. Dim Str_OpType As String
  605. Dim fixIn, fixOut As Integer
  606. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  607.     On Error Resume Next
  608.     With CxbbGrid
  609.         .Width = Me.Width - 160
  610.         .Height = Me.Height - .Top - 400
  611.     End With
  612.     With Pic_Title
  613.         .Width = Me.Width - 160
  614.     End With
  615.     
  616.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  617. End Sub
  618. Private Sub Form_Load()                                                   '窗体装入
  619.   
  620.     '调入打印页面设置窗体
  621.     ReportTitle = "业务类型汇总表"
  622.     XtReportCode = "KF_OpTypeSum"
  623.     Load Dyymctbl
  624.       
  625.     '调整标题栏及网格、格式工具条位置(Fixed)
  626.     Pic_Title.Left = 40
  627.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  628.     CxbbGrid.Left = Pic_Title.Left
  629.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  630.      
  631.     '调 入 网 格(Fixed)
  632.     GridCode = "KF_OpTypeSum"
  633.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  634.       
  635.     Qslz = GridInf(1)
  636.     Sjhgd = GridInf(2)
  637.     Sfxshjwg = GridInf(7)
  638.     Szzls = CxbbGrid.Cols - 1
  639. End Sub
  640. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  641.     '卸载条件窗体
  642.     KF_FrmOptypeSumQuery.UnloadCheck.Value = 1
  643.     Unload KF_FrmOptypeSumQuery
  644.     
  645.     '卸载打印页面设置窗体
  646.     Unload Dyymctbl
  647. End Sub
  648. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  649.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  650. End Sub
  651. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  652.   
  653.     Select Case Button.Key
  654.         Case "bcgs"                                          '保存表格格式
  655.             Call Bcwggs(CxbbGrid, GridCode, GridStr())
  656.         Case "hfmrgs"                                        '恢复默认格式
  657.             Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  658.         Case "szxsxm"                                        '设置显示项目
  659.             Call Szxsxm(CxbbGrid, GridCode)
  660.     End Select
  661. End Sub
  662. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  663. Select Case Button.Key
  664.     Case "ymsz"                                          '页面设置
  665.         Dyymctbl.Show 1
  666.     Case "yl"                                            '预 览
  667.         Call bbyl(True)
  668.     Case "dy"                                            '打 印
  669.         Call bbyl(False)
  670.     Case "cx"                                            '查 询
  671.         KF_FrmOptypeSumQuery.Show 1
  672.     Case "Sum"                                           '汇总
  673.         Call HuiZong
  674.         SzToolbar.Buttons("Sum").Enabled = False
  675.         SzToolbar.Buttons("List").Enabled = True
  676.     Case "List"                                           '明细
  677.         SzToolbar.Buttons("List").Enabled = False
  678.         SzToolbar.Buttons("Sum").Enabled = True
  679.         If Rec_WH.State = 1 Then
  680.             If Rec_WH.RecordCount <> 0 Then
  681.                 If Rec_WH.EOF Then
  682.                     Rec_WH.MoveLast
  683.                 ElseIf Rec_WH.BOF Then
  684.                     Rec_WH.MoveFirst
  685.                 End If
  686.                 Call Show_Tab(Rec_WH)
  687.             End If
  688.         End If
  689.     Case "first"
  690.         Call First
  691.     Case "last"
  692.         Call Last
  693.     Case "prev"
  694.         Call Prev
  695.     Case "next"
  696.         Call Sub_next
  697.     Case "sx"                                            '刷 新
  698.         If Rec_WH.State = 1 Then
  699.           If Rec_WH.RecordCount <> 0 Then
  700.             If Rec_WH.EOF Then
  701.                 Rec_WH.MoveLast
  702.             ElseIf Rec_WH.BOF Then
  703.                 Rec_WH.MoveFirst
  704.             End If
  705.             Call Sub_Query
  706.           End If
  707.         End If
  708.     Case "bz"                                            '帮 助
  709.         Call F1bz
  710.     Case "fh"                                            '退 出
  711.         Unload Me
  712. End Select
  713. End Sub
  714. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  715.     
  716.     Timer1.Enabled = False
  717.     Xt_Wait.Show
  718.     Xt_Wait.Refresh
  719.    
  720.     '加快显示速度
  721.     '生成查询结果
  722.     Call Sub_Query
  723.    
  724.     Xt_Wait.Hide
  725. End Sub
  726. Private Sub Sub_Query()                                    '生成查询结果
  727.     Dim Sqlstr As String                        '查询字符串
  728.     Dim Coljsq As Long                          '网格列计数器
  729.     Dim jsqte As Long                        '临时动态计数器
  730.     Dim Str_WH As String
  731.     Dim str_WH1 As String
  732.     Dim Str_QueryCondi As String             '用户录入查询条件
  733.  '以下为用户自定义部分[
  734.      Str_QueryCondi = ""
  735.      Str_Mate = ""
  736.      With KF_FrmOptypeSumQuery
  737.     
  738.          Str_Class1 = "select distinct opertype from kf_v_inoutclass where OperFlag=1"
  739.          Str_Class2 = "select distinct opertype from kf_v_inoutclass where OperFlag=0"
  740.          Str_WH = "select distinct whcode,whname from KF_V_InOutClass   where 1=1 "
  741.          str_WH1 = "select distinct whcode,whname from KF_V_ledger   where 1=1 "
  742.          
  743.          For jsqte = 1 To 5
  744.             Select Case jsqte
  745.               
  746.                Case 1  '会计期间
  747.                 If Trim(.Combo_Kjqj2.Text) <> "" Then
  748.                     Xtyear = Val(Mid(Trim(.Combo_Kjqj2.Text), 1, 4))
  749.                     Period = Val(Mid(Trim(.Combo_Kjqj2.Text), 6))
  750.                     Str_QueryCondi = Str_QueryCondi & " and kjyear=" & Xtyear & " and Period between " & Val(Mid(Trim(.Combo_Kjqj1.Text), 6)) & " and " & Period
  751.                 End If
  752.               
  753.               Case 2   '仓库
  754.                  If Trim(.LrText(0).Text) <> "" Then
  755.                     Str_QueryCondi = Str_QueryCondi & " and whcode='" & Trim(.LrText(0).Tag) & "'"
  756.                  End If
  757.              
  758.               Case 3   '物料分类
  759.                 If Trim(.LrText(1).Text) <> "" Then
  760.                     Str_QueryCondi = Str_QueryCondi & " and invsortcode LIKE '" & Trim(.LrText(1).Tag) & "%'"
  761.                     Str_Mate = " and invsortcode LIKE '" & Trim(.LrText(1).Tag) & "%'"
  762.                 End If
  763.                 
  764.               Case 4   '物料编码
  765.                 If Trim(.LrText(2).Tag) <> "" Then
  766.                     Str_QueryCondi = Str_QueryCondi & " and mnumber='" & Trim(.LrText(2).Tag) & "'"
  767.                     Str_Mate = " and mnumber='" & Trim(.LrText(2).Tag) & "'"
  768.                 End If
  769.               Case 5        '业务类型
  770.                 If Trim(.LrText(3).Text & "") <> "" Then
  771.                     Str_Mate = " AND opertype='" & Trim(.LrText(3).Text) & "'"
  772.                 End If
  773.             End Select
  774.         Next jsqte
  775.      End With
  776.     Str_WH = Str_WH & Str_QueryCondi & Str_OpType
  777.     str_WH1 = str_WH1 & Str_QueryCondi
  778.     Str_Class1 = Str_Class1 & Str_QueryCondi & Str_OpType
  779.     Str_Class2 = Str_Class2 & Str_QueryCondi & Str_OpType
  780.  
  781.     Set Rec_WH = Cw_DataEnvi.DataConnect.Execute(Str_WH)
  782.     
  783.     If Not Rec_WH.EOF Then
  784.         Rec_WH.MoveFirst
  785.         Call Show_Tab(Rec_WH)
  786.     Else
  787.         Label3 = "仓库编码: " & KF_FrmOptypeSumQuery.LrText(0).Text
  788.         Label1 = "仓库名称: " & KF_FrmOptypeSumQuery.LrText(0).Tag
  789.         Label2 = "日期范围: " & Trim(KF_FrmOptypeSumQuery.Combo_Kjqj1.Text) & "----" & Trim(KF_FrmOptypeSumQuery.Combo_Kjqj2.Text)
  790.         
  791.         CxbbGrid.Clear 1
  792.         CxbbGrid.Rows = CxbbGrid.FixedRows
  793.         
  794.         fixIn = 0
  795.         fixOut = 0
  796.     End If
  797.     
  798. End Sub
  799. Private Sub FillGrid(str1 As String, str2 As String)
  800.     Dim Rec_Class1 As New Recordset
  801.     Set Rec_Class1 = Cw_DataEnvi.DataConnect.Execute(str1 & " and whcode='" & Trim(Rec_WH.Fields("whcode")) & "'")
  802.     Dim Rec_Class2 As New Recordset
  803.     Set Rec_Class2 = Cw_DataEnvi.DataConnect.Execute(str2 & " and whcode='" & Trim(Rec_WH.Fields("whcode")) & "'")
  804.      
  805.     fixIn = Rec_Class1.RecordCount
  806.     fixOut = Rec_Class2.RecordCount
  807.      With CxbbGrid
  808.         .BackColorFixed = &H8000000F    'Dbl_BackColorFixed                           '固定行背景色 ('&H80000018)
  809.         .Cols = Qslz + 10 + Rec_Class1.RecordCount + Rec_Class2.RecordCount
  810.         .AllowUserResizing = flexResizeBoth
  811.         .SelectionMode = flexSelectionByRow
  812.         .ExplorerBar = flexExNone                                  '网格列是否可移动及排序
  813.         .ScrollTips = True
  814.         .WordWrap = True
  815.         
  816.         For jsq = Qslz To .Cols - 1
  817.             .ColHidden(jsq) = False
  818.         Next jsq
  819.         
  820.         '填 充 网 格 标 题
  821.         For Rowjsq = 0 To .FixedRows - 1
  822.             .MergeRow(Rowjsq) = True
  823.             .RowHeight(Rowjsq) = Sjhgd * 1.8
  824.             .TextMatrix(Rowjsq, Qslz) = "物料编码"
  825.             .TextMatrix(Rowjsq, Qslz + 1) = "物料名称"
  826.             .TextMatrix(Rowjsq, Qslz + 2) = "规格型号"
  827.             .TextMatrix(Rowjsq, Qslz + 3) = "计量单位"
  828.             .TextMatrix(Rowjsq, Qslz + 4) = "期初数量"
  829.             .ColHidden(Qslz + 4) = True
  830.             Coljsq = Qslz + 5
  831.             If Not Rec_Class1.EOF Then
  832.                 Rec_Class1.MoveFirst
  833.                 For Coljsq = (Qslz + 5) To (.Cols - 6 - Rec_Class2.RecordCount)
  834.                     .TextMatrix(Rowjsq, Coljsq) = Trim(Rec_Class1.Fields("OperType")) & "数量"
  835.                     .ColWidth(Coljsq) = Sjhgd * 6
  836.                     Rec_Class1.MoveNext
  837.                 Next Coljsq
  838.             End If
  839.             .TextMatrix(Rowjsq, Coljsq) = "无业务类型数量"
  840.             .TextMatrix(Rowjsq, Coljsq + 1) = "合计入库数量"
  841.             If Not Rec_Class2.EOF Then
  842.                 Rec_Class2.MoveFirst
  843.                 For Coljsq = (Qslz + 7 + Rec_Class1.RecordCount) To (.Cols - 4)
  844.                     .TextMatrix(Rowjsq, Coljsq) = Trim(Rec_Class2.Fields("OperType")) & "数量"
  845.                     .ColWidth(Coljsq) = Sjhgd * 6
  846.                     Rec_Class2.MoveNext
  847.                 Next Coljsq
  848.             End If
  849.             .TextMatrix(Rowjsq, (.Cols - 3)) = "无业务类型数量"
  850.             .TextMatrix(Rowjsq, (.Cols - 2)) = "合计出库数量"
  851.             .TextMatrix(Rowjsq, (.Cols - 1)) = "结存数量"
  852.             .ColHidden(.Cols - 1) = True
  853.         Next Rowjsq
  854.         
  855.         '数 据 网 格 高 度
  856.         For Rowjsq = .FixedRows To .Rows - 1
  857.             .RowHeight(Rowjsq) = Sjhgd
  858.         Next Rowjsq
  859.         
  860.         '定 义 录 入 字 段 属 性
  861.         For Coljsq = (Qslz + 4) To .Cols - 1
  862.             .MergeCol(Coljsq) = True
  863.             .ColAlignment(Coljsq) = flexAlignRightTop
  864.             .FixedAlignment(Coljsq) = flexAlignGeneral
  865.         Next Coljsq
  866.         For Coljsq = 0 To .Cols - 1
  867.             If .TextMatrix(0, Coljsq) = "合计入库数量" Or .TextMatrix(0, Coljsq) = "合计出库数量" Then
  868.                 .ColWidth(Coljsq) = Sjhgd * 6
  869.             End If
  870.         Next Coljsq
  871.         .ColWidth(.Cols - 1) = Sjhgd * 6
  872.         .ColWidth(.Cols - 3) = Sjhgd * 6
  873.     End With
  874. End Sub
  875. Private Sub Show_Tab(Rec_Temp As Recordset)
  876.     Dim Str_QC As String
  877.     Dim rec_start As New Recordset
  878.     Dim In_Count As Double
  879.     Dim Out_Count As Double
  880.     Dim Str_Bill As String
  881.     Dim str_temp As String
  882.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  883.     Dim B_F1, B_F2 As Boolean
  884.     
  885.     Call FillGrid(Str_Class1, Str_Class2)
  886.     Label3 = "仓库编码: " & Trim(Rec_Temp.Fields("whcode"))
  887.     Label1 = "仓库名称: " & Trim(Rec_Temp.Fields("whname"))
  888.     Label2 = "日期范围: " & Trim(KF_FrmOptypeSumQuery.Combo_Kjqj1.Text) & "----" & Trim(KF_FrmOptypeSumQuery.Combo_Kjqj2.Text)
  889.         CxbbGrid.Redraw = False
  890.         CxbbGrid.Rows = CxbbGrid.FixedRows
  891.         jsqte = CxbbGrid.Rows
  892.         CxbbGrid.ColHidden(CxbbGrid.Cols - fixOut - 5) = True
  893.         CxbbGrid.ColHidden(CxbbGrid.Cols - 3) = True
  894.         
  895.             Str_Bill = "select a.* ,isnull((SELECT SUM(startquan) FROM KF_V_Ledger WHERE kjyear=" & Xtyear & " and period =" & Val(Mid(Trim(KF_FrmOptypeSumQuery.Combo_Kjqj1.Text), 6)) & " AND mnumber =a.mnumber and whcode='" & Trim(Rec_Temp.Fields("whcode")) & "' group by mnumber),0)as startquan " & _
  896.                         "from (SELECT SUM(factreceiptquan)AS In_count,SUM(factissuequan)AS Out_count,mnumber,OperType, " & _
  897.                         "(select mname from gy_material where mnumber=KF_V_InOutClass.mnumber)as mname,(select model from gy_material where KF_V_InOutClass.mnumber=gy_material.mnumber) as model, " & _
  898.                         "(select primaryunitname from gy_material where KF_V_InOutClass.mnumber=gy_material.mnumber) as primaryunitname From KF_V_InOutClass " & _
  899.                         "where whcode='" & Trim(Rec_Temp.Fields("whcode")) & "'  and kjyear=" & Xtyear & " and period between " & Val(Mid(Trim(KF_FrmOptypeSumQuery.Combo_Kjqj1.Text), 6)) & " and " & Val(Mid(Trim(KF_FrmOptypeSumQuery.Combo_Kjqj2.Text), 6)) & Str_Mate & "  GROUP BY mnumber, OperType)a order by mnumber"
  900.             
  901.             Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Str_Bill)
  902.             Dim Sum_In As Double, Sum_Out As Double
  903.             Sum_In = 0
  904.             Sum_Out = 0
  905.             If Not Rec_Query.EOF Then
  906.                 Rec_Query.MoveFirst
  907.                 CxbbGrid.AddItem ""
  908.                 CxbbGrid.TextMatrix(jsqte, Qslz) = Trim(Rec_Query.Fields("mnumber"))                '物料编码
  909.                 CxbbGrid.TextMatrix(jsqte, Qslz + 1) = Trim(Rec_Query.Fields("mname"))              '物料名称
  910.                 CxbbGrid.TextMatrix(jsqte, Qslz + 2) = Trim(Rec_Query.Fields("model"))              '规格型号
  911.                 CxbbGrid.TextMatrix(jsqte, Qslz + 3) = Trim(Rec_Query.Fields("primaryunitname"))    '计量单位
  912.                 CxbbGrid.TextMatrix(jsqte, Qslz + 4) = Val(Rec_Query.Fields("startquan"))           '期初数量
  913.                 CxbbGrid.TextMatrix(jsqte, Qslz + 4) = 0
  914.                 CxbbGrid.RowHeight(jsqte) = Sjhgd
  915.                 Do While Not Rec_Query.EOF
  916.                     If Trim(Rec_Query.Fields("mnumber")) = Trim(CxbbGrid.TextMatrix(jsqte, Qslz)) Then      '将行转换成列
  917.                         If Trim(Rec_Query.Fields("OperType") & "") = "" Then
  918.                             If Val(Rec_Query.Fields("In_count")) <> 0 Then
  919.                                 CxbbGrid.ColHidden(CxbbGrid.Cols - fixOut - 5) = False
  920.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 5)) = Val(Rec_Query.Fields("In_count"))            '入库数量
  921.                                 Sum_In = Sum_In + Val(Rec_Query.Fields("In_count"))
  922.                             End If
  923.                             
  924.                             If Val(Rec_Query.Fields("out_count")) <> 0 Then
  925.                                 CxbbGrid.ColHidden(CxbbGrid.Cols - 3) = False
  926.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - 3)) = Val(Rec_Query.Fields("Out_count"))                    '出库数量
  927.                                 Sum_Out = Sum_Out + Val(Rec_Query.Fields("Out_count"))
  928.                             End If
  929.                         End If
  930.                         For Coljsq = (Qslz + 5) To CxbbGrid.Cols - 3
  931.                             If Trim(Rec_Query.Fields("OperType")) & "数量" = Trim(CxbbGrid.TextMatrix(0, Coljsq)) Then
  932.                                 If Val(Rec_Query.Fields("In_count")) <> 0 Then
  933.                                     CxbbGrid.TextMatrix(jsqte, Coljsq) = Val(Rec_Query.Fields("In_count"))                              '入库数量
  934.                                     Sum_In = Sum_In + Val(Rec_Query.Fields("In_count"))
  935.                                 Else
  936.                                     CxbbGrid.TextMatrix(jsqte, Coljsq) = Val(Rec_Query.Fields("Out_count"))                             '出库数量
  937.                                     Sum_Out = Sum_Out + Val(Rec_Query.Fields("Out_count"))
  938.                                 End If
  939.                             End If
  940.                         Next
  941.                         CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 2) = Sum_Out
  942.                         CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 4)) = Sum_In
  943.                         CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 1) = Val(CxbbGrid.TextMatrix(jsqte, Qslz + 4)) + Sum_In - Sum_Out    '结存数量
  944.                         Rec_Query.MoveNext
  945.                     Else
  946.                         jsqte = jsqte + 1
  947.                         CxbbGrid.AddItem ""
  948.                         CxbbGrid.TextMatrix(jsqte, Qslz) = Trim(Rec_Query.Fields("mnumber"))                            '物料编码
  949.                         CxbbGrid.TextMatrix(jsqte, Qslz + 1) = Trim(Rec_Query.Fields("mname"))                          '物料名称
  950.                         CxbbGrid.TextMatrix(jsqte, Qslz + 2) = Trim(Rec_Query.Fields("model"))                          '规格型号
  951.                         CxbbGrid.TextMatrix(jsqte, Qslz + 3) = Trim(Rec_Query.Fields("primaryunitname"))                '计量单位
  952.                         CxbbGrid.TextMatrix(jsqte, Qslz + 4) = Val(Rec_Query.Fields("startquan"))                       '期初数量
  953.                         CxbbGrid.TextMatrix(jsqte, Qslz + 4) = 0
  954.                         CxbbGrid.RowHeight(jsqte) = Sjhgd
  955.                         If Trim(Rec_Query.Fields("OperType") & "") = "" Then
  956.                             If Val(Rec_Query.Fields("In_count")) <> 0 Then
  957.                                 CxbbGrid.ColHidden(CxbbGrid.Cols - fixOut - 5) = False
  958.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 5)) = Val(Rec_Query.Fields("In_count"))        '入库数量
  959.                                 Sum_In = Sum_In + Val(Rec_Query.Fields("In_count"))
  960.                             End If
  961.                             
  962.                             If Val(Rec_Query.Fields("out_count")) <> 0 Then
  963.                                 CxbbGrid.ColHidden(CxbbGrid.Cols - 3) = False
  964.                                 CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - 3)) = Val(Rec_Query.Fields("Out_count"))                '出库数量
  965.                                 Sum_Out = Sum_Out + Val(Rec_Query.Fields("Out_count"))
  966.                             End If
  967.                         End If
  968.                         For Coljsq = (Qslz + 5) To CxbbGrid.Cols - 3
  969.                             If Trim(Rec_Query.Fields("OperType")) & "数量" = Trim(CxbbGrid.TextMatrix(0, Coljsq)) Then
  970.                                 If Val(Rec_Query.Fields("In_count")) <> 0 Then
  971.                                     CxbbGrid.TextMatrix(jsqte, Coljsq) = Val(Rec_Query.Fields("In_count"))                          '入库数量
  972.                                     Sum_In = Sum_In + Val(Rec_Query.Fields("In_count"))
  973.                                 Else
  974.                                     CxbbGrid.TextMatrix(jsqte, Coljsq) = Val(Rec_Query.Fields("Out_count"))                         '出库数量
  975.                                     Sum_Out = Sum_Out + Val(Rec_Query.Fields("Out_count"))
  976.                                 End If
  977.                             End If
  978.                         Next
  979.                         CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 2) = Sum_Out
  980.                         CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 4)) = Sum_In
  981.                         CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 1) = Val(CxbbGrid.TextMatrix(jsqte, Qslz + 4)) + Sum_In - Sum_Out        '结存数量
  982.                         Rec_Query.MoveNext
  983.                     End If
  984.                 Loop
  985.             Else
  986.                 Str_QC = "SELECT SUM(startquan) AS startquan, whcode, mnumber, whname, mname, primaryunitname, model" & _
  987.                     " FROM KF_V_Ledger WHERE kjyear=" & Xtyear & " and period =" & Val(Mid(Trim(KF_FrmOptypeSumQuery.Combo_Kjqj1.Text), 6)) & " AND mnumber ='" & Trim(Rec_Mate.Fields("mnumber")) & "'" & " and whcode='" & Trim(Rec_Temp.Fields("whcode")) & "'" & _
  988.                     " GROUP BY whcode, mnumber, whname, mname, primaryunitname, model"
  989.                 
  990.                 Set rec_start = Cw_DataEnvi.DataConnect.Execute(Str_QC)
  991.                 If Not rec_start.EOF Then
  992.                     CxbbGrid.AddItem ""
  993.                     CxbbGrid.TextMatrix(jsqte, Qslz) = Trim(rec_start.Fields("mnumber"))            '物料编码
  994.                     CxbbGrid.TextMatrix(jsqte, Qslz + 1) = Trim(rec_start.Fields("mname"))          '物料名称
  995.                     CxbbGrid.TextMatrix(jsqte, Qslz + 2) = Trim(rec_start.Fields("model"))          '规格型号
  996.                     CxbbGrid.TextMatrix(jsqte, Qslz + 3) = Trim(rec_start.Fields("primaryunitname"))    '计量单位
  997.                     CxbbGrid.TextMatrix(jsqte, Qslz + 4) = 0
  998.                     CxbbGrid.TextMatrix(jsqte, Qslz + 4) = Val(rec_start.Fields("startquan"))           '期初数量
  999.                     CxbbGrid.RowHeight(jsqte) = Sjhgd
  1000.                     CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 2) = Sum_Out
  1001.                     CxbbGrid.TextMatrix(jsqte, (CxbbGrid.Cols - fixOut - 4)) = Sum_In
  1002.                     CxbbGrid.TextMatrix(jsqte, CxbbGrid.Cols - 1) = Val(CxbbGrid.TextMatrix(jsqte, Qslz + 4)) + Sum_In - Sum_Out        '结存数量
  1003.                     jsqte = jsqte + 1
  1004.                 End If
  1005.             End If
  1006.     Call SLGSH
  1007.     If Not SzToolbar.Buttons("Sum").Enabled Then
  1008.         Call HuiZong
  1009.     End If
  1010.     CxbbGrid.Redraw = True
  1011. End Sub
  1012. Private Sub SLGSH()         '数据格式化
  1013.     With CxbbGrid
  1014.         For hjsq = .FixedRows To .Rows - 1
  1015.             For ljsq = Qslz + 4 To .Cols - 1
  1016.                 .TextMatrix(hjsq, ljsq) = Format(Trim(.TextMatrix(hjsq, ljsq)), "#,##0." + String(Xtslxsws, "0"))
  1017.                 
  1018.                 If Val(.TextMatrix(hjsq, ljsq)) = 0 Then
  1019.                     .TextMatrix(hjsq, ljsq) = ""
  1020.                 End If
  1021.             Next ljsq
  1022.         Next hjsq
  1023.     End With
  1024. End Sub
  1025. Private Sub HuiZong()       '汇总数据
  1026.     With CxbbGrid
  1027.         If fixIn > 0 Then
  1028.             For jsq = (Qslz + 5) To (Qslz + 5 + fixIn)
  1029.                 .ColHidden(jsq) = True
  1030.             Next
  1031.         End If
  1032.         If fixOut > 0 Then
  1033.             For jsq = (Qslz + 7 + fixIn) To (.Cols - 3)
  1034.                 .ColHidden(jsq) = True
  1035.             Next
  1036.         End If
  1037.     
  1038.     End With
  1039. End Sub
  1040. Private Sub First()
  1041.     If Rec_WH.State = 1 Then
  1042.         If Rec_WH.RecordCount > 0 Then
  1043.             Rec_WH.MoveFirst
  1044.             Call Show_Tab(Rec_WH)
  1045.         End If
  1046.     End If
  1047. End Sub
  1048. Private Sub Last()
  1049.     If Rec_WH.State = 1 Then
  1050.         If Rec_WH.RecordCount > 0 Then
  1051.             Rec_WH.MoveLast
  1052.             Call Show_Tab(Rec_WH)
  1053.         End If
  1054.     End If
  1055. End Sub
  1056. Private Sub Prev()
  1057.     If Rec_WH.State = 1 Then
  1058.         If Rec_WH.RecordCount > 0 Then
  1059.             If Rec_WH.EOF Then
  1060.                 Rec_WH.MovePrevious
  1061.             End If
  1062.             If Not Rec_WH.BOF Then
  1063.                 Rec_WH.MovePrevious
  1064.                 If Not Rec_WH.BOF Then
  1065.                     Call Show_Tab(Rec_WH)
  1066.                 End If
  1067.             End If
  1068.         End If
  1069.     End If
  1070. End Sub
  1071. Private Sub Sub_next()
  1072.     If Rec_WH.State = 1 Then
  1073.         If Rec_WH.RecordCount > 0 Then
  1074.             If Rec_WH.BOF Then
  1075.                 Rec_WH.MoveNext
  1076.             End If
  1077.             If Not Rec_WH.EOF Then
  1078.                 Rec_WH.MoveNext
  1079.                 If Not Rec_WH.EOF Then
  1080.                     Call Show_Tab(Rec_WH)
  1081.                 End If
  1082.             End If
  1083.         End If
  1084.     End If
  1085. End Sub
  1086. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1087.     
  1088.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1089.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1090.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1091.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1092.     ReDim Bbxbt(1 To Bbxbtgs)
  1093.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1094.     If Bbbwhgs <> 0 Then
  1095.         ReDim Bbbwh(1 To Bbbwhgs)
  1096.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1097.     End If
  1098.     Bbzbt = ReportTitle
  1099.     Bbxbt(1) = ""
  1100.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  1101.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1102.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1103.     If Not bbylte Then
  1104.         Unload DY_Tybbyldy
  1105.     End If
  1106. End Sub