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

企业管理

开发平台:

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_FrmCashStruA 
  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            =   4200
  40.          TabIndex        =   5
  41.          Top             =   390
  42.          Width           =   5580
  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             =   240
  64.          Width           =   2295
  65.       End
  66.    End
  67.    Begin MSComctlLib.Toolbar GsToolbar 
  68.       Height          =   525
  69.       Left            =   9720
  70.       TabIndex        =   0
  71.       Top             =   30
  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_FrmCashStruA"
  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_CashStruA"
  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_CashStruA"
  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_FrmCashChangeC.UnloadCheck.Value = 1
  470.     Unload XJ_FrmCashChangeC
  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_FrmCashChangeC.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.     Dim Rec_SumQuery As New ADODB.Recordset     '查询汇总结果动态集
  520.     
  521.     Dim SqlStr As String                        '查询动态连接字符串
  522.     
  523.     Dim I As Integer                             '为0清空循环变量
  524.     Dim Dtm_CurrBegin As Date                        '分析期间查询开始日期
  525.     Dim Dtm_CurrEnd As Date                          '分析期间查询结束日期
  526.     Dim Dtm_CompBegin As Date                        '对比期间查询开始日期
  527.     Dim Dtm_CompEnd As Date                          '对比期间查询结束日期
  528.     
  529.     Dim Curr_V As Currency
  530.     Dim Comp_V As Currency
  531.     Dim Curr_Sum_V As Currency
  532.     Dim Comp_Sum_V As Currency
  533.     
  534.     '以下为用户自定义部分[
  535.     
  536.     With XJ_FrmCashChangeC
  537.         '显示查询会计期间
  538.         Dtm_CurrBegin = .lrText(0).Text
  539.         Dtm_CurrEnd = .lrText(1).Text
  540.         Dtm_CompBegin = .lrText(2).Text
  541.         Dtm_CompEnd = .lrText(3).Text
  542.         
  543.         Lab_TitleText(0).Caption = "分析期间:" & .lrText(0).Text & "--" & .lrText(1).Text & _
  544.         "    对比期间:" & .lrText(2).Text & "--" & .lrText(3).Text
  545.     End With
  546.     
  547.     SqlStr = "exec Cwfx_Sp_CashCompare '" & Dtm_CurrBegin & "','" & Dtm_CurrEnd & "','" & Dtm_CompBegin & "','" & Dtm_CompEnd & "'"
  548.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(SqlStr)
  549.     
  550.     '以下为现金流入项目
  551.     Curr_Sum_V = 0
  552.     Comp_Sum_V = 0
  553.     
  554.     With Rec_Query
  555.     .Filter = "direction = 0"
  556.         Do While Not .EOF
  557.             Curr_Sum_V = Curr_Sum_V + IIf(IsNull(.Fields("Curr_V")), 0, .Fields("Curr_V"))
  558.             Comp_Sum_V = Comp_Sum_V + IIf(IsNull(.Fields("Comp_V")), 0, .Fields("Comp_V"))
  559.             .MoveNext
  560.         Loop
  561.     End With
  562.     
  563.     If Rec_Query.RecordCount <> 0 Then Rec_Query.MoveFirst
  564.     
  565.     With Rec_Query
  566.         CxbbGrid.Rows = CxbbGrid.FixedRows
  567.         CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  568.         Jsqte = CxbbGrid.FixedRows
  569.         
  570.         If Jsqte >= CxbbGrid.Rows Then
  571.             CxbbGrid.AddItem ""
  572.         End If
  573.         
  574.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流入科目"
  575.         Jsqte = Jsqte + 1
  576.         
  577.         Sum_CurrV = 0
  578.         Sum_CompV = 0
  579.         
  580.         '填写现金流入具体项目
  581.         .Filter = "direction = 0"
  582.         Do While Not .EOF
  583.             If Jsqte >= CxbbGrid.Rows Then
  584.                 CxbbGrid.AddItem ""
  585.             End If
  586.             
  587.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Space(2) & .Fields("Cname") '科目名称
  588.             
  589.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  590.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  591.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  592.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  593.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = 0
  594.             
  595.             Curr_V = IIf(IsNull(.Fields("Curr_V")), 0, .Fields("Curr_V"))
  596.             Comp_V = IIf(IsNull(.Fields("Comp_V")), 0, .Fields("Comp_V"))
  597.             
  598.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Curr_V
  599.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Comp_V
  600.             
  601.             If Curr_Sum_V <> 0 Then
  602.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Curr_V / Curr_Sum_V * 100
  603.             End If
  604.             If Comp_Sum_V <> 0 Then
  605.                 CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Comp_V / Comp_Sum_V * 100
  606.             End If
  607.             
  608.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = _
  609.             Val(CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls))) - _
  610.             Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)))
  611.             
  612.             
  613.             For I = 2 To 6                    '从第002---005列为统计数值数据,为0清空
  614.                 If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  615.                     CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  616.                 End If
  617.             Next I
  618.             
  619.             Jsqte = Jsqte + 1
  620.             
  621.             '移动到下一条记录
  622.             .MoveNext
  623.         Loop
  624.     End With
  625.     
  626.     If Jsqte >= CxbbGrid.Rows Then
  627.         CxbbGrid.AddItem ""                                     '此行为现金流入合计行
  628.     End If
  629.     
  630.     CxbbGrid.Cell(flexcpBackColor, Jsqte, Qslz, Jsqte, Qslz + 6 - 1) = QBColor(11)
  631.     
  632.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流入合计"
  633.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  634.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  635.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  636.     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  637.     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = 0
  638.     
  639.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Curr_Sum_V
  640.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Comp_Sum_V
  641.     If Curr_Sum_V <> 0 Then
  642.         CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 100
  643.     End If
  644.     If Comp_Sum_V <> 0 Then
  645.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 100
  646.     End If
  647.     
  648.     For I = 2 To 6                    '从第2列开始到5列为统计数值数据,为0清空
  649.         If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  650.             CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  651.         End If
  652.     Next
  653.     
  654.     If Rec_Query.RecordCount <> 0 Then Rec_Query.MoveFirst
  655.     
  656.     '以下为现金流出项目
  657.     Jsqte = Jsqte + 1
  658.     
  659.     Curr_Sum_V = 0
  660.     Comp_Sum_V = 0
  661.    
  662.     With Rec_Query
  663.     .Filter = "direction = 1"
  664.        Do While Not .EOF
  665.             Curr_Sum_V = Curr_Sum_V + IIf(IsNull(.Fields("Curr_V")), 0, .Fields("Curr_V"))
  666.             Comp_Sum_V = Comp_Sum_V + IIf(IsNull(.Fields("Comp_V")), 0, .Fields("Comp_V"))
  667.             .MoveNext
  668.         Loop
  669.     End With
  670.     
  671.     With Rec_Query
  672.         If Jsqte >= CxbbGrid.Rows Then
  673.             CxbbGrid.AddItem ""
  674.         End If
  675.         
  676.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流出科目"
  677.         Jsqte = Jsqte + 1
  678.         
  679.         '填写现金流入具体项目
  680.         .Filter = "direction = 1"
  681.         Do While Not .EOF
  682.             If Jsqte >= CxbbGrid.Rows Then
  683.                 CxbbGrid.AddItem ""
  684.             End If
  685.             
  686.             CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Space(2) & .Fields("Cname") '科目名称
  687.             
  688.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  689.             CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  690.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  691.             CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  692.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = 0
  693.             
  694.             Curr_V = IIf(IsNull(.Fields("Curr_V")), 0, .Fields("Curr_V"))
  695.             Comp_V = IIf(IsNull(.Fields("Comp_V")), 0, .Fields("Comp_V"))
  696.             
  697.             CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Curr_V
  698.             CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Comp_V
  699.             
  700.             If Curr_Sum_V <> 0 Then
  701.                 CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Curr_V / Curr_Sum_V * 100
  702.             End If
  703.             If Comp_Sum_V <> 0 Then
  704.                 CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Comp_V / Comp_Sum_V * 100
  705.             End If
  706.             
  707.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = _
  708.             Val(CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls))) - _
  709.             Val(CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)))
  710.             
  711.             
  712.             For I = 2 To 6                    '从第002---005列为统计数值数据,为0清空
  713.                 If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  714.                     CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  715.                 End If
  716.             Next I
  717.             
  718.             Jsqte = Jsqte + 1
  719.             
  720.             '移动到下一条记录
  721.             .MoveNext
  722.         Loop
  723.     End With
  724.     
  725.     If Jsqte >= CxbbGrid.Rows Then
  726.         CxbbGrid.AddItem ""                                     '此行为现金流出合计行
  727.     End If
  728.     
  729.     CxbbGrid.Cell(flexcpBackColor, Jsqte, Qslz, Jsqte, Qslz + 6 - 1) = QBColor(11)
  730.     
  731.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = "现金流出合计"
  732.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = 0
  733.     CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 0
  734.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = 0
  735.     CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 0
  736.     CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = 0
  737.     
  738.     CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Curr_Sum_V
  739.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Comp_Sum_V
  740.     If Curr_Sum_V <> 0 Then
  741.         CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = 100
  742.     End If
  743.     If Comp_Sum_V <> 0 Then
  744.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = 100
  745.     End If
  746.     
  747.     For I = 2 To 6                    '从第2列开始到5列为统计数值数据,为0清空
  748.         If CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = 0 Then
  749.             CxbbGrid.TextMatrix(Jsqte, Sydz(IIf(I > 9, "0", "00") + Trim(Str(I)), GridStr(), Szzls)) = ""
  750.         End If
  751.     Next
  752.     
  753. End Sub
  754. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  755.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  756.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  757.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  758.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  759.     ReDim Bbxbt(1 To Bbxbtgs)
  760.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  761.     If Bbbwhgs <> 0 Then
  762.         ReDim Bbbwh(1 To Bbbwhgs)
  763.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  764.     End If
  765.     Bbzbt = ReportTitle
  766.     Bbxbt(1) = Space(2) & Lab_TitleText(0).Caption
  767.     bbxbtzzxs(1) = 0                                    '报表行组织形式(0-居左 1-居中 2-居右)
  768.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  769.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  770.     If Not bbylte Then
  771.         Unload DY_Tybbyldy
  772.     End If
  773. End Sub