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

企业管理

开发平台:

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 XJ_FrmCash 
  5.    Caption         =   "现金收支分析表"
  6.    ClientHeight    =   8340
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11385
  10.    HelpContextID   =   5001
  11.    Icon            =   "现金收支_收支表分析结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8340
  16.    ScaleWidth      =   11385
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.Timer Timer1 
  19.       Enabled         =   0   'False
  20.       Interval        =   1
  21.       Left            =   7620
  22.       Top             =   90
  23.    End
  24.    Begin VB.PictureBox Pic_Title 
  25.       Height          =   795
  26.       Left            =   0
  27.       Picture         =   "现金收支_收支表分析结果.frx":1042
  28.       ScaleHeight     =   735
  29.       ScaleWidth      =   11535
  30.       TabIndex        =   1
  31.       Top             =   570
  32.       Width           =   11595
  33.       Begin VB.Label Lab_TitleText 
  34.          AutoSize        =   -1  'True
  35.          BackStyle       =   0  'Transparent
  36.          ForeColor       =   &H00FF0000&
  37.          Height          =   180
  38.          Index           =   0
  39.          Left            =   3420
  40.          TabIndex        =   5
  41.          Top             =   300
  42.          Width           =   7620
  43.       End
  44.       Begin VB.Label TsLabel 
  45.          AutoSize        =   -1  'True
  46.          BackColor       =   &H80000018&
  47.          BackStyle       =   0  'Transparent
  48.          Caption         =   "现金收支分析表"
  49.          BeginProperty Font 
  50.             Name            =   "宋体"
  51.             Size            =   12
  52.             Charset         =   134
  53.             Weight          =   700
  54.             Underline       =   0   'False
  55.             Italic          =   0   'False
  56.             Strikethrough   =   0   'False
  57.          EndProperty
  58.          ForeColor       =   &H00000000&
  59.          Height          =   240
  60.          Index           =   4
  61.          Left            =   630
  62.          TabIndex        =   2
  63.          Top             =   210
  64.          Width           =   1785
  65.       End
  66.    End
  67.    Begin MSComctlLib.Toolbar GsToolbar 
  68.       Height          =   525
  69.       Left            =   9510
  70.       TabIndex        =   0
  71.       Top             =   0
  72.       Width           =   1665
  73.       _ExtentX        =   2937
  74.       _ExtentY        =   926
  75.       ButtonWidth     =   1455
  76.       ButtonHeight    =   926
  77.       AllowCustomize  =   0   'False
  78.       Appearance      =   1
  79.       Style           =   1
  80.       ImageList       =   "ImageList1"
  81.       _Version        =   393216
  82.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  83.          NumButtons      =   2
  84.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  85.             Caption         =   "保存格式"
  86.             Key             =   "bcgs"
  87.             ImageKey        =   "bcgs"
  88.          EndProperty
  89.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  90.             Caption         =   "默认列宽"
  91.             Key             =   "hfmrgs"
  92.             ImageKey        =   "mrlk"
  93.          EndProperty
  94.       EndProperty
  95.    End
  96.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  97.       Height          =   6885
  98.       Left            =   0
  99.       TabIndex        =   3
  100.       Top             =   1410
  101.       Width           =   11595
  102.       _cx             =   5080
  103.       _cy             =   5080
  104.       Appearance      =   1
  105.       BorderStyle     =   1
  106.       Enabled         =   -1  'True
  107.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  108.          Name            =   "宋体"
  109.          Size            =   9
  110.          Charset         =   134
  111.          Weight          =   400
  112.          Underline       =   0   'False
  113.          Italic          =   0   'False
  114.          Strikethrough   =   0   'False
  115.       EndProperty
  116.       MousePointer    =   0
  117.       BackColor       =   16777215
  118.       ForeColor       =   -2147483640
  119.       BackColorFixed  =   12632256
  120.       ForeColorFixed  =   -2147483630
  121.       BackColorSel    =   -2147483635
  122.       ForeColorSel    =   -2147483634
  123.       BackColorBkg    =   -2147483636
  124.       BackColorAlternate=   16777215
  125.       GridColor       =   -2147483633
  126.       GridColorFixed  =   -2147483632
  127.       TreeColor       =   -2147483632
  128.       FloodColor      =   192
  129.       SheetBorder     =   -2147483642
  130.       FocusRect       =   1
  131.       HighLight       =   1
  132.       AllowSelection  =   -1  'True
  133.       AllowBigSelection=   -1  'True
  134.       AllowUserResizing=   0
  135.       SelectionMode   =   0
  136.       GridLines       =   1
  137.       GridLinesFixed  =   2
  138.       GridLineWidth   =   1
  139.       Rows            =   50
  140.       Cols            =   10
  141.       FixedRows       =   1
  142.       FixedCols       =   1
  143.       RowHeightMin    =   0
  144.       RowHeightMax    =   0
  145.       ColWidthMin     =   0
  146.       ColWidthMax     =   0
  147.       ExtendLastCol   =   0   'False
  148.       FormatString    =   ""
  149.       ScrollTrack     =   0   'False
  150.       ScrollBars      =   3
  151.       ScrollTips      =   0   'False
  152.       MergeCells      =   0
  153.       MergeCompare    =   0
  154.       AutoResize      =   -1  'True
  155.       AutoSizeMode    =   0
  156.       AutoSearch      =   0
  157.       AutoSearchDelay =   2
  158.       MultiTotals     =   -1  'True
  159.       SubtotalPosition=   1
  160.       OutlineBar      =   0
  161.       OutlineCol      =   0
  162.       Ellipsis        =   0
  163.       ExplorerBar     =   0
  164.       PicturesOver    =   0   'False
  165.       FillStyle       =   0
  166.       RightToLeft     =   0   'False
  167.       PictureType     =   0
  168.       TabBehavior     =   0
  169.       OwnerDraw       =   0
  170.       Editable        =   0
  171.       ShowComboButton =   1
  172.       WordWrap        =   0   'False
  173.       TextStyle       =   0
  174.       TextStyleFixed  =   0
  175.       OleDragMode     =   0
  176.       OleDropMode     =   0
  177.       DataMode        =   0
  178.       VirtualData     =   -1  'True
  179.       DataMember      =   ""
  180.       ComboSearch     =   3
  181.       AutoSizeMouse   =   -1  'True
  182.       FrozenRows      =   0
  183.       FrozenCols      =   0
  184.       AllowUserFreezing=   0
  185.       BackColorFrozen =   0
  186.       ForeColorFrozen =   0
  187.       WallPaperAlignment=   9
  188.       AccessibleName  =   ""
  189.       AccessibleDescription=   ""
  190.       AccessibleValue =   ""
  191.       AccessibleRole  =   24
  192.    End
  193.    Begin MSComctlLib.Toolbar SzToolbar 
  194.       Align           =   1  'Align Top
  195.       Height          =   555
  196.       Left            =   0
  197.       TabIndex        =   4
  198.       Top             =   0
  199.       Width           =   11385
  200.       _ExtentX        =   20082
  201.       _ExtentY        =   979
  202.       ButtonWidth     =   820
  203.       ButtonHeight    =   926
  204.       AllowCustomize  =   0   'False
  205.       Appearance      =   1
  206.       Style           =   1
  207.       ImageList       =   "ImageList1"
  208.       _Version        =   393216
  209.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  210.          NumButtons      =   8
  211.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  212.             Caption         =   "设置"
  213.             Key             =   "ymsz"
  214.             ImageKey        =   "sz"
  215.          EndProperty
  216.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  217.             Caption         =   "打印"
  218.             Key             =   "dy"
  219.             ImageKey        =   "dy"
  220.          EndProperty
  221.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  222.             Caption         =   "预览"
  223.             Key             =   "yl"
  224.             ImageKey        =   "yl"
  225.          EndProperty
  226.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  227.             Style           =   3
  228.          EndProperty
  229.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  230.             Caption         =   "查询"
  231.             Key             =   "cx"
  232.             ImageKey        =   "cx"
  233.          EndProperty
  234.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  235.             Style           =   3
  236.          EndProperty
  237.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  238.             Caption         =   "帮助"
  239.             Key             =   "bz"
  240.             ImageKey        =   "bz"
  241.          EndProperty
  242.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  243.             Caption         =   "退出"
  244.             Key             =   "fh"
  245.             ImageKey        =   "tc"
  246.          EndProperty
  247.       EndProperty
  248.       BorderStyle     =   1
  249.       Begin MSComctlLib.ImageList ImageList1 
  250.          Left            =   5700
  251.          Top             =   0
  252.          _ExtentX        =   1005
  253.          _ExtentY        =   1005
  254.          BackColor       =   -2147483643
  255.          ImageWidth      =   16
  256.          ImageHeight     =   16
  257.          MaskColor       =   12632256
  258.          _Version        =   393216
  259.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  260.             NumListImages   =   35
  261.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  262.                Picture         =   "现金收支_收支表分析结果.frx":35106
  263.                Key             =   "sz"
  264.             EndProperty
  265.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  266.                Picture         =   "现金收支_收支表分析结果.frx":354A0
  267.                Key             =   "dy"
  268.             EndProperty
  269.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  270.                Picture         =   "现金收支_收支表分析结果.frx":3583A
  271.                Key             =   "yl"
  272.             EndProperty
  273.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  274.                Picture         =   "现金收支_收支表分析结果.frx":35BD4
  275.                Key             =   "xg"
  276.             EndProperty
  277.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  278.                Picture         =   "现金收支_收支表分析结果.frx":35F6E
  279.                Key             =   "zh"
  280.             EndProperty
  281.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  282.                Picture         =   "现金收支_收支表分析结果.frx":36308
  283.                Key             =   "sh"
  284.             EndProperty
  285.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  286.                Picture         =   "现金收支_收支表分析结果.frx":366A2
  287.                Key             =   "bc"
  288.             EndProperty
  289.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  290.                Picture         =   "现金收支_收支表分析结果.frx":36A3C
  291.                Key             =   "fq"
  292.             EndProperty
  293.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  294.                Picture         =   "现金收支_收支表分析结果.frx":36DD6
  295.                Key             =   "bz"
  296.             EndProperty
  297.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  298.                Picture         =   "现金收支_收支表分析结果.frx":37170
  299.                Key             =   "tc"
  300.             EndProperty
  301.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  302.                Picture         =   "现金收支_收支表分析结果.frx":3750A
  303.                Key             =   "bcgs"
  304.             EndProperty
  305.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  306.                Picture         =   "现金收支_收支表分析结果.frx":378A4
  307.                Key             =   "mrlk"
  308.             EndProperty
  309.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  310.                Picture         =   "现金收支_收支表分析结果.frx":37C3E
  311.                Key             =   "xsxm"
  312.             EndProperty
  313.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  314.                Picture         =   "现金收支_收支表分析结果.frx":37FD8
  315.                Key             =   "first"
  316.             EndProperty
  317.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  318.                Picture         =   "现金收支_收支表分析结果.frx":38372
  319.                Key             =   "prev"
  320.             EndProperty
  321.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  322.                Picture         =   "现金收支_收支表分析结果.frx":3870C
  323.                Key             =   "next"
  324.             EndProperty
  325.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  326.                Picture         =   "现金收支_收支表分析结果.frx":38AA6
  327.                Key             =   "last"
  328.             EndProperty
  329.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  330.                Picture         =   "现金收支_收支表分析结果.frx":38E40
  331.                Key             =   "xx"
  332.             EndProperty
  333.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  334.                Picture         =   "现金收支_收支表分析结果.frx":391DA
  335.                Key             =   "define"
  336.             EndProperty
  337.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  338.                Picture         =   "现金收支_收支表分析结果.frx":39574
  339.                Key             =   "exec"
  340.             EndProperty
  341.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  342.                Picture         =   "现金收支_收支表分析结果.frx":3990E
  343.                Key             =   "xz"
  344.             EndProperty
  345.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  346.                Picture         =   "现金收支_收支表分析结果.frx":39CA8
  347.                Key             =   "sc"
  348.             EndProperty
  349.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  350.                Picture         =   "现金收支_收支表分析结果.frx":3A042
  351.                Key             =   "sx"
  352.             EndProperty
  353.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  354.                Picture         =   "现金收支_收支表分析结果.frx":3A3DC
  355.                Key             =   "cx"
  356.             EndProperty
  357.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  358.                Picture         =   "现金收支_收支表分析结果.frx":3A776
  359.                Key             =   "zd"
  360.             EndProperty
  361.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  362.                Picture         =   "现金收支_收支表分析结果.frx":3AB10
  363.                Key             =   "dz"
  364.             EndProperty
  365.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  366.                Picture         =   "现金收支_收支表分析结果.frx":3AEAA
  367.                Key             =   "ph"
  368.             EndProperty
  369.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  370.                Picture         =   "现金收支_收支表分析结果.frx":3B244
  371.                Key             =   "fz"
  372.             EndProperty
  373.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  374.                Picture         =   "现金收支_收支表分析结果.frx":3B5DE
  375.                Key             =   "dw"
  376.             EndProperty
  377.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  378.                Picture         =   "现金收支_收支表分析结果.frx":3B978
  379.                Key             =   "hf"
  380.             EndProperty
  381.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  382.                Picture         =   "现金收支_收支表分析结果.frx":3BD12
  383.                Key             =   "pz"
  384.             EndProperty
  385.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  386.                Picture         =   "现金收支_收支表分析结果.frx":3C0AC
  387.                Key             =   "check"
  388.             EndProperty
  389.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  390.                Picture         =   "现金收支_收支表分析结果.frx":3C446
  391.                Key             =   "zz"
  392.             EndProperty
  393.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  394.                Picture         =   "现金收支_收支表分析结果.frx":3C7E0
  395.                Key             =   "mx"
  396.             EndProperty
  397.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  398.                Picture         =   "现金收支_收支表分析结果.frx":3CB7A
  399.                Key             =   "lj"
  400.             EndProperty
  401.          EndProperty
  402.       End
  403.    End
  404. End
  405. Attribute VB_Name = "XJ_FrmCash"
  406. Attribute VB_GlobalNameSpace = False
  407. Attribute VB_Creatable = False
  408. Attribute VB_PredeclaredId = True
  409. Attribute VB_Exposed = False
  410. '*********************************************************************
  411. '*    模 块 名 称 :现金收支表分析结果(公用窗体)
  412. '*    功 能 描 述 :
  413. '*    程序员姓名  :魏永生
  414. '*    最后修改人  :
  415. '*    最后修改时间:2002/1/21
  416. '*    备        注:程序中所有依实际情况自定义部分均用[>>  <<]括起
  417. '*********************************************************************
  418. Dim ReportTitle As String                '报表主标题
  419. '以下为固定使用变量
  420. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  421. Dim GridCode As String                   '显示网格网格代码
  422. Dim GridInf() As Variant                 '整个网格设置信息
  423. Dim Tsxx As String                       '系统提示信息
  424. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  425. Dim Sjhgd As Double                      '网格数据行高度
  426. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  427. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  428. Dim GridStr()  As String                 '网格列信息(字符型)
  429. Dim GridInt() As Integer                 '网格列信息(整型)
  430. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  431. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  432.     On Error Resume Next
  433.     With CxbbGrid
  434.         .Width = Me.Width - 160
  435.         .Height = Me.Height - .Top - 400
  436.     End With
  437.     With Pic_Title
  438.         .Width = Me.Width - 160
  439.     End With
  440.     
  441.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  442. End Sub
  443. Private Sub Form_Load()                  '窗体装入
  444.     
  445.     '调入打印页面设置窗体
  446.     ReportTitle = "现金收支分析表"
  447.     
  448.     XtReportCode = "cwfx_CashA"
  449.     Load Dyymctbl
  450.     
  451.     '调整标题栏及网格、格式工具条位置
  452.     Pic_Title.Left = 40
  453.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  454.     CxbbGrid.Left = Pic_Title.Left
  455.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  456.     
  457.     '调 入 网 格
  458.     GridCode = "cwfx_CashA"
  459.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  460.     
  461.     Qslz = GridInf(1)
  462.     Sjhgd = GridInf(2)
  463.     Sfxshjwg = GridInf(7)
  464.     Szzls = CxbbGrid.Cols - 1
  465.     
  466. End Sub
  467. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  468.     '卸载条件窗体
  469.     XJ_FrmCashC.UnloadCheck.Value = 1
  470.     Unload XJ_FrmCashC
  471.     '卸载打印页面设置窗体
  472.     Unload Dyymctbl
  473. End Sub
  474. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  475.     Select Case Button.Key
  476.     Case "bcgs"                                          '保存表格格式
  477.         Call Bcwggs(CxbbGrid, GridCode, GridStr())
  478.     Case "hfmrgs"                                        '恢复默认格式
  479.         Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  480.     Case "szxsxm"                                        '设置显示项目
  481.         Call Szxsxm(CxbbGrid, GridCode)
  482.     End Select
  483. End Sub
  484. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  485.     Select Case Button.Key
  486.     Case "ymsz"                                          '页面设置
  487.         Dyymctbl.Show 1
  488.     Case "yl"                                            '预 览
  489.         Call bbyl(True)
  490.     Case "dy"                                            '打 印
  491.         Call bbyl(False)
  492.     Case "cx"                                            '查 询
  493.         XJ_FrmCashC.Show 1
  494.     Case "bz"                                            '帮 助
  495.         Call F1bz
  496.     Case "fh"                                            '退 出
  497.         Unload Me
  498.     End Select
  499. End Sub
  500. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  501.     Timer1.Enabled = False
  502.     
  503.     XT_Wait.Show
  504.     XT_Wait.Refresh
  505.     
  506.     '加快显示速度
  507.     CxbbGrid.Redraw = False
  508.     
  509.     '生成查询结果
  510.     Call Sub_Query
  511.     
  512.     CxbbGrid.Redraw = True
  513.     
  514.     XT_Wait.Hide
  515.     
  516. End Sub
  517. Private Sub Sub_Query()                                    '生成查询结果
  518.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  519.     
  520.     Dim SqlStr As String                        '查询动态连接字符串
  521.     
  522.     Dim I As Integer                             '为0清空循环变量
  523.     Dim Dtm_Begin As Date                        '查询开始日期
  524.     Dim Dtm_End As Date                          '查询结束日期
  525.     Dim Sum_V As Currency
  526.     Dim Sum_YearV As Currency
  527.     Dim Sum_YearVB As Currency
  528.     Dim V As Currency
  529.     Dim YearV As Currency
  530.     Dim YearVB As Currency
  531.     
  532.     
  533.     
  534.     '以下为用户自定义部分[
  535.     
  536.     With XJ_FrmCashC
  537.         '显示查询会计期间
  538.         
  539.         Dtm_Begin = .lrText(0).Text
  540.         Dtm_End = .lrText(1).Text
  541.         Lab_TitleText(0).Caption = "开始日期:" & .lrText(0).Text & "     结束日期:" & .lrText(1).Text
  542.         
  543.     End With
  544.     SqlStr = "exec Cwfx_Sp_CashA '" & Dtm_Begin & "','" & Dtm_End & "'"
  545.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  546.     
  547.     
  548.     '以下为现金流入项目
  549.     
  550.     With Rec_Query
  551.         
  552.         CxbbGrid.Rows = CxbbGrid.FixedRows
  553.         CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  554.         Jsqte = CxbbGrid.FixedRows
  555.         
  556.         If Jsqte >= CxbbGrid.Rows Then
  557.             CxbbGrid.AddItem ""
  558.         End If
  559.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流入科目"
  560.         Jsqte = Jsqte + 1
  561.         
  562.         Sum_V = 0
  563.         Sum_YearV = 0
  564.         Sum_YearVB = 0
  565.         '填写现金流入具体项目
  566.         .Filter = "direction = 0"
  567.         Do While Not .EOF
  568.             If Jsqte >= CxbbGrid.Rows Then
  569.                 CxbbGrid.AddItem ""
  570.             End If
  571.             
  572.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Space(2) & .Fields("Cname") '科目名称
  573.             
  574.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  575.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  576.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  577.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  578.             
  579.             V = IIf(IsNull(.Fields("V")), 0, .Fields("V"))
  580.             YearV = IIf(IsNull(.Fields("YearV")), 0, .Fields("YearV"))
  581.             YearVB = IIf(IsNull(.Fields("YearVB")), 0, .Fields("YearVB"))
  582.             
  583.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = V
  584.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = YearV
  585.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = YearVB
  586.         
  587.             If YearVB <> 0 Then
  588.                 CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = YearV / YearVB * 100
  589.             End If
  590.             
  591.             
  592.             For I = 2 To 5                    '从第002---005列为统计数值数据,为0清空
  593.                 If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  594.                     CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  595.                 End If
  596.             Next I
  597.             
  598.             Jsqte = Jsqte + 1
  599.             
  600.             Sum_V = Sum_V + V
  601.             Sum_YearV = Sum_YearV + YearV
  602.             Sum_YearVB = Sum_YearVB + YearVB
  603.             
  604.             '移动到下一条记录
  605.             .MoveNext
  606.         Loop
  607.         
  608.     End With
  609.     
  610.     If Jsqte >= CxbbGrid.Rows Then
  611.         CxbbGrid.AddItem ""                                     '此行为现金流入合计行
  612.     End If
  613.     
  614.     CxbbGrid.Cell(flexcpBackColor, Jsqte, 2, Jsqte, 6) = QBColor(11)
  615.     
  616.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流入合计"
  617.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  618.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  619.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  620.     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  621.     
  622.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Sum_V
  623.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Sum_YearV
  624.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Sum_YearVB
  625.     If Sum_YearVB <> 0 Then
  626.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Sum_YearV / Sum_YearVB * 100
  627.     End If
  628.     
  629.     For I = 2 To 5                    '从第2列开始到5列为统计数值数据,为0清空
  630.         If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  631.             CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  632.         End If
  633.     Next
  634.     
  635.     If Rec_Query.RecordCount <> 0 Then Rec_Query.MoveFirst
  636.     
  637.     '以下为现金流出项目
  638.     Jsqte = Jsqte + 1
  639.     
  640.     With Rec_Query
  641.         
  642.         If Jsqte >= CxbbGrid.Rows Then
  643.             CxbbGrid.AddItem ""
  644.         End If
  645.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流出科目"
  646.         Jsqte = Jsqte + 1
  647.         
  648.         Sum_V = 0
  649.         Sum_YearV = 0
  650.         Sum_YearVB = 0
  651.         .Filter = "direction = 1"
  652.         Do While Not .EOF
  653.             If Jsqte >= CxbbGrid.Rows Then
  654.                 CxbbGrid.AddItem ""
  655.             End If
  656.             
  657.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Space(2) & .Fields("Cname") '科目名称
  658.             
  659.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  660.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  661.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  662.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  663.             
  664.             V = IIf(IsNull(.Fields("V")), 0, .Fields("V"))
  665.             YearV = IIf(IsNull(.Fields("YearV")), 0, .Fields("YearV"))
  666.             YearVB = IIf(IsNull(.Fields("YearVB")), 0, .Fields("YearVB"))
  667.             
  668.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = V
  669.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = YearV
  670.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = YearVB
  671.         
  672.             If YearVB <> 0 Then
  673.                 CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = YearV / YearVB * 100
  674.             End If
  675.             
  676.             
  677.             For I = 2 To 5                    '从第002--005列为统计数值数据,为0清空
  678.                 If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  679.                     CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  680.                 End If
  681.             Next I
  682.             
  683.             Jsqte = Jsqte + 1
  684.             
  685.             Sum_V = Sum_V + V
  686.             Sum_YearV = Sum_YearV + YearV
  687.             Sum_YearVB = Sum_YearVB + YearVB
  688.             
  689.             '移动到下一条记录
  690.             .MoveNext
  691.         Loop
  692.         
  693.     End With
  694.     
  695.     If Jsqte >= CxbbGrid.Rows Then
  696.         CxbbGrid.AddItem ""
  697.     End If
  698.     
  699.     CxbbGrid.Cell(flexcpBackColor, Jsqte, Qslz, Jsqte, Qslz + 5 - 1) = QBColor(11)
  700.     
  701.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流出合计"
  702.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  703.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  704.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  705.     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  706.     
  707.     
  708.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Sum_V
  709.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Sum_YearV
  710.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Sum_YearVB
  711.     If Sum_YearVB <> 0 Then
  712.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Sum_YearV / Sum_YearVB * 100
  713.     End If
  714.    
  715.     
  716.     For I = 2 To 5                    '从第2列开始到5列为统计数值数据,为0清空
  717.         If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  718.             CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  719.         End If
  720.     Next
  721.     
  722. End Sub
  723. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  724.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  725.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  726.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  727.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  728.     ReDim Bbxbt(1 To Bbxbtgs)
  729.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  730.     If Bbbwhgs <> 0 Then
  731.         ReDim Bbbwh(1 To Bbbwhgs)
  732.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  733.     End If
  734.     Bbzbt = ReportTitle
  735.     Bbxbt(1) = Space(2) & Lab_TitleText(0).Caption
  736.     bbxbtzzxs(1) = 0                                    '报表行组织形式(0-居左 1-居中 2-居右)
  737.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  738.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  739.     If Not bbylte Then
  740.         Unload DY_Tybbyldy
  741.     End If
  742. End Sub