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

企业管理

开发平台:

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