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

企业管理

开发平台:

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 ZF_Kh_Frmslzzjg 
  5.    Caption         =   "客户_三栏式总帐"
  6.    ClientHeight    =   7755
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11190
  10.    HelpContextID   =   5001
  11.    Icon            =   "辅助_客户_三栏总帐查询结果.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   7755
  16.    ScaleWidth      =   11190
  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          =   1185
  26.       Left            =   0
  27.       Picture         =   "辅助_客户_三栏总帐查询结果.frx":0442
  28.       ScaleHeight     =   1125
  29.       ScaleWidth      =   11535
  30.       TabIndex        =   0
  31.       Top             =   570
  32.       Width           =   11595
  33.       Begin VB.ComboBox Combo_AccFormat 
  34.          Height          =   300
  35.          Left            =   9360
  36.          Style           =   2  'Dropdown List
  37.          TabIndex        =   4
  38.          Top             =   150
  39.          Width           =   1725
  40.       End
  41.       Begin MSComctlLib.ImageCombo Imgebo_FzCode 
  42.          Height          =   315
  43.          Left            =   6810
  44.          TabIndex        =   9
  45.          Top             =   780
  46.          Width           =   4275
  47.          _ExtentX        =   7541
  48.          _ExtentY        =   556
  49.          _Version        =   393216
  50.          ForeColor       =   -2147483640
  51.          BackColor       =   -2147483643
  52.          Locked          =   -1  'True
  53.       End
  54.       Begin MSComctlLib.ImageCombo Imgebo_FzCcode 
  55.          Height          =   315
  56.          Left            =   1800
  57.          TabIndex        =   11
  58.          Top             =   780
  59.          Width           =   3645
  60.          _ExtentX        =   6429
  61.          _ExtentY        =   556
  62.          _Version        =   393216
  63.          ForeColor       =   -2147483640
  64.          BackColor       =   -2147483643
  65.          Locked          =   -1  'True
  66.       End
  67.       Begin VB.Label Lab_TitleMess 
  68.          AutoSize        =   -1  'True
  69.          BackStyle       =   0  'Transparent
  70.          Caption         =   "科目名称:"
  71.          Height          =   180
  72.          Index           =   1
  73.          Left            =   990
  74.          TabIndex        =   12
  75.          Top             =   840
  76.          Width           =   810
  77.       End
  78.       Begin VB.Label Lab_TitleMess 
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "往来客户:"
  81.          Height          =   225
  82.          Index           =   3
  83.          Left            =   5970
  84.          TabIndex        =   10
  85.          Top             =   840
  86.          Width           =   915
  87.       End
  88.       Begin VB.Label Lab_TitleText 
  89.          BackStyle       =   0  'Transparent
  90.          ForeColor       =   &H00000000&
  91.          Height          =   225
  92.          Index           =   1
  93.          Left            =   6870
  94.          TabIndex        =   8
  95.          Top             =   210
  96.          Width           =   1395
  97.       End
  98.       Begin VB.Label Lab_TitleMess 
  99.          BackStyle       =   0  'Transparent
  100.          Caption         =   "外币名称:"
  101.          Height          =   225
  102.          Index           =   2
  103.          Left            =   5970
  104.          TabIndex        =   7
  105.          Top             =   210
  106.          Visible         =   0   'False
  107.          Width           =   915
  108.       End
  109.       Begin VB.Label TsLabel 
  110.          AutoSize        =   -1  'True
  111.          BackStyle       =   0  'Transparent
  112.          Caption         =   "帐页格式:"
  113.          Height          =   180
  114.          Index           =   7
  115.          Left            =   8520
  116.          TabIndex        =   5
  117.          Top             =   210
  118.          Width           =   810
  119.       End
  120.       Begin VB.Label TsLabel 
  121.          BackColor       =   &H80000018&
  122.          BackStyle       =   0  'Transparent
  123.          Caption         =   "客户三栏式总帐"
  124.          BeginProperty Font 
  125.             Name            =   "宋体"
  126.             Size            =   14.25
  127.             Charset         =   134
  128.             Weight          =   700
  129.             Underline       =   0   'False
  130.             Italic          =   0   'False
  131.             Strikethrough   =   0   'False
  132.          EndProperty
  133.          ForeColor       =   &H00000000&
  134.          Height          =   330
  135.          Index           =   4
  136.          Left            =   600
  137.          TabIndex        =   1
  138.          Top             =   150
  139.          Width           =   2355
  140.       End
  141.    End
  142.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  143.       Height          =   6885
  144.       Left            =   30
  145.       TabIndex        =   2
  146.       Top             =   1860
  147.       Width           =   11715
  148.       _cx             =   5080
  149.       _cy             =   5080
  150.       Appearance      =   1
  151.       BorderStyle     =   1
  152.       Enabled         =   -1  'True
  153.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  154.          Name            =   "宋体"
  155.          Size            =   9
  156.          Charset         =   134
  157.          Weight          =   400
  158.          Underline       =   0   'False
  159.          Italic          =   0   'False
  160.          Strikethrough   =   0   'False
  161.       EndProperty
  162.       MousePointer    =   0
  163.       BackColor       =   16777215
  164.       ForeColor       =   -2147483640
  165.       BackColorFixed  =   12632256
  166.       ForeColorFixed  =   -2147483630
  167.       BackColorSel    =   -2147483635
  168.       ForeColorSel    =   -2147483634
  169.       BackColorBkg    =   -2147483636
  170.       BackColorAlternate=   16777215
  171.       GridColor       =   -2147483633
  172.       GridColorFixed  =   -2147483632
  173.       TreeColor       =   -2147483632
  174.       FloodColor      =   192
  175.       SheetBorder     =   -2147483642
  176.       FocusRect       =   1
  177.       HighLight       =   1
  178.       AllowSelection  =   -1  'True
  179.       AllowBigSelection=   -1  'True
  180.       AllowUserResizing=   0
  181.       SelectionMode   =   0
  182.       GridLines       =   1
  183.       GridLinesFixed  =   2
  184.       GridLineWidth   =   1
  185.       Rows            =   50
  186.       Cols            =   10
  187.       FixedRows       =   1
  188.       FixedCols       =   1
  189.       RowHeightMin    =   0
  190.       RowHeightMax    =   0
  191.       ColWidthMin     =   0
  192.       ColWidthMax     =   0
  193.       ExtendLastCol   =   0   'False
  194.       FormatString    =   ""
  195.       ScrollTrack     =   0   'False
  196.       ScrollBars      =   3
  197.       ScrollTips      =   0   'False
  198.       MergeCells      =   0
  199.       MergeCompare    =   0
  200.       AutoResize      =   -1  'True
  201.       AutoSizeMode    =   0
  202.       AutoSearch      =   0
  203.       AutoSearchDelay =   2
  204.       MultiTotals     =   -1  'True
  205.       SubtotalPosition=   1
  206.       OutlineBar      =   0
  207.       OutlineCol      =   0
  208.       Ellipsis        =   0
  209.       ExplorerBar     =   0
  210.       PicturesOver    =   0   'False
  211.       FillStyle       =   0
  212.       RightToLeft     =   0   'False
  213.       PictureType     =   0
  214.       TabBehavior     =   0
  215.       OwnerDraw       =   0
  216.       Editable        =   0
  217.       ShowComboButton =   1
  218.       WordWrap        =   0   'False
  219.       TextStyle       =   0
  220.       TextStyleFixed  =   0
  221.       OleDragMode     =   0
  222.       OleDropMode     =   0
  223.       DataMode        =   0
  224.       VirtualData     =   -1  'True
  225.       DataMember      =   ""
  226.       ComboSearch     =   3
  227.       AutoSizeMouse   =   -1  'True
  228.       FrozenRows      =   0
  229.       FrozenCols      =   0
  230.       AllowUserFreezing=   0
  231.       BackColorFrozen =   0
  232.       ForeColorFrozen =   0
  233.       WallPaperAlignment=   9
  234.       AccessibleName  =   ""
  235.       AccessibleDescription=   ""
  236.       AccessibleValue =   ""
  237.       AccessibleRole  =   24
  238.    End
  239.    Begin MSComctlLib.Toolbar SzToolbar 
  240.       Align           =   1  'Align Top
  241.       Height          =   555
  242.       Left            =   0
  243.       TabIndex        =   3
  244.       Top             =   0
  245.       Width           =   11190
  246.       _ExtentX        =   19738
  247.       _ExtentY        =   979
  248.       ButtonWidth     =   820
  249.       ButtonHeight    =   926
  250.       AllowCustomize  =   0   'False
  251.       Appearance      =   1
  252.       Style           =   1
  253.       ImageList       =   "ImageList1"
  254.       _Version        =   393216
  255.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  256.          NumButtons      =   8
  257.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  258.             Caption         =   "设置"
  259.             Key             =   "ymsz"
  260.             ImageKey        =   "sz"
  261.          EndProperty
  262.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  263.             Caption         =   "打印"
  264.             Key             =   "dy"
  265.             ImageKey        =   "dy"
  266.          EndProperty
  267.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  268.             Caption         =   "预览"
  269.             Key             =   "yl"
  270.             ImageKey        =   "yl"
  271.          EndProperty
  272.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  273.             Style           =   3
  274.          EndProperty
  275.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  276.             Caption         =   "查询"
  277.             Key             =   "cx"
  278.             ImageKey        =   "cx"
  279.          EndProperty
  280.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  281.             Style           =   3
  282.          EndProperty
  283.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  284.             Caption         =   "帮助"
  285.             Key             =   "bz"
  286.             ImageKey        =   "bz"
  287.          EndProperty
  288.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  289.             Caption         =   "退出"
  290.             Key             =   "fh"
  291.             ImageKey        =   "tc"
  292.          EndProperty
  293.       EndProperty
  294.       BorderStyle     =   1
  295.       Begin MSComctlLib.ImageList ImageList1 
  296.          Left            =   6600
  297.          Top             =   0
  298.          _ExtentX        =   1005
  299.          _ExtentY        =   1005
  300.          BackColor       =   -2147483643
  301.          ImageWidth      =   16
  302.          ImageHeight     =   16
  303.          MaskColor       =   12632256
  304.          _Version        =   393216
  305.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  306.             NumListImages   =   34
  307.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  308.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":34506
  309.                Key             =   "sz"
  310.             EndProperty
  311.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  312.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":348A0
  313.                Key             =   "dy"
  314.             EndProperty
  315.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  316.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":34C3A
  317.                Key             =   "yl"
  318.             EndProperty
  319.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  320.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":34FD4
  321.                Key             =   "xg"
  322.             EndProperty
  323.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  324.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3536E
  325.                Key             =   "zh"
  326.             EndProperty
  327.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  328.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":35708
  329.                Key             =   "sh"
  330.             EndProperty
  331.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  332.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":35AA2
  333.                Key             =   "bc"
  334.             EndProperty
  335.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  336.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":35E3C
  337.                Key             =   "fq"
  338.             EndProperty
  339.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  340.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":361D6
  341.                Key             =   "bz"
  342.             EndProperty
  343.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  344.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":36570
  345.                Key             =   "tc"
  346.             EndProperty
  347.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  348.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3690A
  349.                Key             =   "bcgs"
  350.             EndProperty
  351.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  352.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":36CA4
  353.                Key             =   "mrlk"
  354.             EndProperty
  355.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  356.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3703E
  357.                Key             =   "xsxm"
  358.             EndProperty
  359.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  360.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":373D8
  361.                Key             =   "first"
  362.             EndProperty
  363.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  364.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":37772
  365.                Key             =   "prev"
  366.             EndProperty
  367.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  368.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":37B0C
  369.                Key             =   "next"
  370.             EndProperty
  371.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  372.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":37EA6
  373.                Key             =   "last"
  374.             EndProperty
  375.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  376.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":38240
  377.                Key             =   "xx"
  378.             EndProperty
  379.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  380.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":385DA
  381.                Key             =   "define"
  382.             EndProperty
  383.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  384.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":38974
  385.                Key             =   "exec"
  386.             EndProperty
  387.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  388.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":38D0E
  389.                Key             =   "xz"
  390.             EndProperty
  391.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  392.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":390A8
  393.                Key             =   "sc"
  394.             EndProperty
  395.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  396.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":39442
  397.                Key             =   "sx"
  398.             EndProperty
  399.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  400.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":397DC
  401.                Key             =   "cx"
  402.             EndProperty
  403.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  404.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":39B76
  405.                Key             =   "zd"
  406.             EndProperty
  407.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  408.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":39F10
  409.                Key             =   "dz"
  410.             EndProperty
  411.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  412.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3A2AA
  413.                Key             =   "ph"
  414.             EndProperty
  415.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  416.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3A644
  417.                Key             =   "fz"
  418.             EndProperty
  419.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  420.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3A9DE
  421.                Key             =   "dw"
  422.             EndProperty
  423.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  424.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3AD78
  425.                Key             =   "hf"
  426.             EndProperty
  427.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  428.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3B112
  429.                Key             =   "pz"
  430.             EndProperty
  431.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  432.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3B4AC
  433.                Key             =   "check"
  434.             EndProperty
  435.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  436.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3B846
  437.                Key             =   "zz"
  438.             EndProperty
  439.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  440.                Picture         =   "辅助_客户_三栏总帐查询结果.frx":3BBE0
  441.                Key             =   "mx"
  442.             EndProperty
  443.          EndProperty
  444.       End
  445.       Begin MSComctlLib.Toolbar GsToolbar 
  446.          Height          =   525
  447.          Left            =   9510
  448.          TabIndex        =   6
  449.          Top             =   0
  450.          Width           =   1665
  451.          _ExtentX        =   2937
  452.          _ExtentY        =   926
  453.          ButtonWidth     =   1455
  454.          ButtonHeight    =   926
  455.          AllowCustomize  =   0   'False
  456.          Appearance      =   1
  457.          Style           =   1
  458.          ImageList       =   "ImageList1"
  459.          _Version        =   393216
  460.          BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  461.             NumButtons      =   2
  462.             BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  463.                Caption         =   "保存格式"
  464.                Key             =   "bcgs"
  465.                ImageKey        =   "bcgs"
  466.             EndProperty
  467.             BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  468.                Caption         =   "默认列宽"
  469.                Key             =   "hfmrgs"
  470.                ImageKey        =   "mrlk"
  471.             EndProperty
  472.          EndProperty
  473.       End
  474.    End
  475. End
  476. Attribute VB_Name = "ZF_Kh_Frmslzzjg"
  477. Attribute VB_GlobalNameSpace = False
  478. Attribute VB_Creatable = False
  479. Attribute VB_PredeclaredId = True
  480. Attribute VB_Exposed = False
  481. '*********************************************************************
  482. '*    模 块 名 称 :客户_三栏式总分类帐
  483. '*    功 能 描 述 :本功能用于查询某科目某客户的总分类帐
  484. '*                 并且能够进行立体联查明细帐数据。
  485. '*    程序员姓名  :张建忠
  486. '*    最后修改人  :奚俊峰
  487. '*    最后修改时间:2001.12.28
  488. '*    备        注:
  489. '*********************************************************************
  490. Dim ReportTitle As String                '报表主标题
  491. '以下为固定使用变量
  492. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  493. Dim GridCode As String                   '显示网格网格代码
  494. Dim GridInf() As Variant                 '整个网格设置信息
  495. Dim Tsxx As String                       '系统提示信息
  496. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  497. Dim Sjhgd As Double                      '网格数据行高度
  498. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  499. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  500. Dim GridStr()  As String                 '网格列信息(字符型)
  501. Dim GridInt() As Integer                 '网格列信息(整型)
  502. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  503. Dim Bln_Stop As Boolean                  '停止输出查询结果
  504. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  505.     On Error Resume Next
  506.     With CxbbGrid
  507.         .Width = Me.Width - 160
  508.         .Height = Me.Height - .Top - 400
  509.     End With
  510.     With Pic_Title
  511.         .Width = Me.Width - 160
  512.     End With
  513.     
  514.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  515. End Sub
  516. Private Sub Form_Load()                                                   '窗体装入
  517.     '========bsj================
  518.     '设置窗体图标与主界面图标一致
  519.     Me.Icon = XT_Main.Icon
  520.     '==========================
  521.     '调入打印页面设置窗体
  522.     XtReportCode = "Cwzz_kh_slzz"
  523.     Load Dyymctbl
  524.     ReportTitle = "客户三栏式总帐"
  525.     
  526.     '调整标题栏及网格、格式工具条位置
  527.     Pic_Title.Left = 40
  528.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  529.     CxbbGrid.Left = Pic_Title.Left
  530.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  531.     
  532.     '调 入 网 格
  533.     GridCode = "Cwzz_kh_slzz"
  534.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  535.     
  536.     Qslz = GridInf(1)
  537.     Sjhgd = GridInf(2)
  538.     Sfxshjwg = GridInf(7)
  539.     Szzls = CxbbGrid.Cols - 1
  540.     
  541.     '填充查询年度
  542.     CxbbGrid.TextMatrix(0, Sydz("001", GridStr(), Szzls)) = Trim(Str(Xtyear)) + "年"
  543.     CxbbGrid.TextMatrix(0, Sydz("002", GridStr(), Szzls)) = Trim(Str(Xtyear)) + "年"
  544.     
  545.     '帐页格式
  546.     Call FillCombo(Combo_AccFormat, "Cwzz_zygs", "", 0)
  547.     '调整标题位置
  548.     SetTitlePos tsLabel(4)
  549.     
  550. End Sub
  551. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  552.     '卸载条件窗体
  553.     ZF_Kh_Frmslzztj.UnloadCheck.Value = 1
  554.     Unload ZF_Kh_Frmslzztj
  555.     '卸载打印页面设置窗体
  556.     Unload Dyymctbl
  557. End Sub
  558. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  559.     Select Case Button.Key
  560.     Case "bcgs"                                          '保存表格格式
  561.         Call Bcwggs(CxbbGrid, GridCode, GridStr)
  562.     Case "hfmrgs"                                        '恢复默认格式
  563.         Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  564.     Case "szxsxm"                                        '设置显示项目
  565.         Call Szxsxm(CxbbGrid, GridCode)
  566.     End Select
  567. End Sub
  568. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  569.     Select Case Button.Key
  570.     Case "ymsz"                                          '页面设置
  571.         Dyymctbl.Show 1
  572.     Case "yl"                                            '预 览
  573.         Call bbyl(True)
  574.     Case "dy"                                            '打 印
  575.         Call bbyl(False)
  576.     Case "cx"                                            '查 询
  577.         ZF_Kh_Frmslzztj.Show 1
  578.     Case "bz"                                            '帮 助
  579.         Call F1bz
  580.     Case "fh"                                            '退 出
  581.         Unload Me
  582.     End Select
  583. End Sub
  584. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  585.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  586.     Dim Str_QueryCondi As String                '用户录入查询条件
  587.     
  588.     Timer1.Enabled = False
  589.     
  590.     With ZF_Kh_Frmslzztj
  591.         '辅助查询科目
  592.         Call FillImageCombo(Imgebo_FzCcode, "Cwzz_khwlkm", 0)
  593.         
  594.         For Jsqte = 1 To Imgebo_FzCcode.ComboItems.count
  595.             If Imgebo_FzCcode.ComboItems.Item(Jsqte).Text = ZF_Kh_Frmslzztj.Imgebo_FzCcode.Text Then
  596.                 Imgebo_FzCcode.ComboItems.Item(Jsqte).Selected = True
  597.                 Imgebo_FzCcode.Refresh
  598.                 Exit For
  599.             End If
  600.         Next Jsqte
  601.         
  602.         '查询客户
  603.         Call FillImageCombo(Imgebo_FzCode, "Cwzz_cus", 0)
  604.         For Jsqte = 1 To Imgebo_FzCode.ComboItems.count
  605.             If Imgebo_FzCode.ComboItems.Item(Jsqte).Key = "@" + Trim(ZF_Kh_Frmslzztj.LrText(0).Tag) Then
  606.                 Imgebo_FzCode.ComboItems.Item(Jsqte).Selected = True
  607.                 Imgebo_FzCode.Refresh
  608.                 Exit For
  609.             End If
  610.         Next Jsqte
  611.     End With
  612.     
  613.     '生成查询结果
  614.     Call Sub_ScQuery
  615.     
  616. End Sub
  617. Private Sub Imgebo_FzCcode_Click()                        '点击科目列表
  618.     Call Sub_ScQuery
  619. End Sub
  620. Private Sub Imgebo_FzCode_Click()                         '点击辅助客户列表
  621.     Call Sub_ScQuery
  622. End Sub
  623. Private Sub Sub_ScQuery()                                 '生成查询结果
  624.     Xt_Wait.Show
  625.     Xt_Wait.Refresh
  626.     CxbbGrid.Redraw = True
  627.     
  628.     '加快显示速度
  629.     CxbbGrid.Redraw = False
  630.     
  631.     '生成查询结果
  632.     Call Sub_Query
  633.     
  634.     CxbbGrid.Redraw = True
  635.     
  636.     Xt_Wait.Hide
  637. End Sub
  638. Private Sub Sub_Query()                                    '生成查询结果
  639.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  640.     Dim Rec_AccSum As New ADODB.Recordset       '科目总帐动态集
  641.     Dim Str_Ccode As String                     '查询科目
  642.     Dim Str_FzCode As String                    '查询辅助客户编码
  643.     Dim Sqlstr As String                        '查询字符串
  644.     Dim Coljsq As Long                          '网格列计数器
  645.     Dim Jsqte As Long                           '临时动态计数器
  646.     Dim Int_Year As Integer                     '查询会计年度
  647.     Dim Bln_IncluNotBook As Boolean             '是否包含未记帐凭证
  648.     Dim Bln_EndFlag As Boolean                  '判断当前科目是否为末级科目
  649.     Dim Bln_ForeignFlag As Boolean              '判断此科目是否外币核算
  650.     Dim Int_DqPeriod As Integer                 '查询进行当前会计期间
  651.     
  652.     Dim Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#   '期初金额,数量,外币
  653.     Dim Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj# '本期合计(金额,数量,外币)
  654.     Dim Dbl_Jejflj#, Dbl_Jedflj#, Dbl_Sljflj#, Dbl_Sldflj#, Dbl_Wbjflj#, Dbl_Wbdflj# '截止累计(金额,数量,外币)
  655.     Dim Dbl_Qmyete#, Dbl_Qmslte#, Dbl_Qmwbte#   '期末金额,数量,外币
  656.     '以下为用户自定义部分[
  657.     
  658.     '清除原查询数据
  659.     CxbbGrid.Rows = CxbbGrid.FixedRows
  660.     
  661.     '得到当前查询科目,并判断是否为末级科目
  662.     Str_Ccode = GetComboKey(Imgebo_FzCcode, 0)
  663.     Sqlstr = "SELECT EndFlag,AccFormat,ForeignFlag,ForeignCurrName,ConVertFlag From Cwzz_AccCode Left JOIN Gy_ForeignCurrency ON" & _
  664.     " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode Where Ccode='" & Str_Ccode & "'"
  665.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  666.     If Not RecTemp.EOF Then
  667.         Bln_EndFlag = RecTemp.Fields("EndFlag")
  668.         Combo_AccFormat.Text = Trim(RecTemp.Fields("AccFormat"))
  669.         If RecTemp.Fields("ForeignFlag") Then
  670.             Lab_TitleMess(2).Visible = True
  671.             Lab_TitleText(1).Caption = Trim(RecTemp.Fields("ForeignCurrName") & "")
  672.             Bln_ForeignFlag = True
  673.             Bln_ConVertFlag = IIf(IsNull(RecTemp.Fields("ConVertFlag")), False, RecTemp.Fields("ConVertFlag"))
  674.         Else
  675.             Lab_TitleMess(2).Visible = False
  676.             Bln_ForeignFlag = False
  677.             Lab_TitleText(1).Caption = ""
  678.         End If
  679.     End If
  680.     
  681.     '得到查询辅助客户编码
  682.     Str_FzCode = GetComboKey(Imgebo_FzCode, 0)
  683.     
  684.     '得到查询年度,并判断是否包含未记帐凭证
  685.     With ZF_Kh_Frmslzztj
  686.         
  687.         Int_Year = Xtyear
  688.         
  689.         '是否包含未记帐凭证
  690.         If .Chk_NotBook.Value = 1 Then
  691.             Bln_IncluNotBook = True
  692.         Else
  693.             Bln_IncluNotBook = False
  694.         End If
  695.         
  696.     End With
  697.     
  698.     '初始化各种值
  699.     Dbl_Qcyete = 0
  700.     Dbl_Qcslte = 0
  701.     Dbl_Qcwbte = 0
  702.     
  703.     Dbl_Jejfhj = 0
  704.     Dbl_Jedfhj = 0
  705.     Dbl_Sljfhj = 0
  706.     Dbl_Sldfhj = 0
  707.     Dbl_Wbjfhj = 0
  708.     Dbl_Wbdfhj = 0
  709.     
  710.     Dbl_Jejflj = 0
  711.     Dbl_Jedflj = 0
  712.     Dbl_Sljflj = 0
  713.     Dbl_Sldflj = 0
  714.     Dbl_Wbjflj = 0
  715.     Dbl_Wbdflj = 0
  716.     
  717.     Jsqte = CxbbGrid.FixedRows - 1
  718.     
  719.     '1.读出上年结转余额(数量,外币,金)
  720.     Sqlstr = "SELECT Qcyehj=Isnull(Sum(Qcye),0),Qcslhj=Isnull(Sum(Qcsl),0),Qcwbhj=Isnull(Sum(Qcwb),0) From Cwzz_AccSumAssi Where Ccode LIKE '" & Str_Ccode & "%' And CusCode='" & Str_FzCode & "'And Year=" & Int_Year & " And Period=1"
  721.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  722.     If Not RecTemp.EOF Then
  723.         Dbl_Qcyete = RecTemp.Fields("Qcyehj")
  724.         Dbl_Qcslte = RecTemp.Fields("Qcslhj")
  725.         Dbl_Qcwbte = RecTemp.Fields("Qcwbhj")
  726.     End If
  727.     
  728.     CxbbGrid.AddItem ""
  729.     Jsqte = Jsqte + 1
  730.     
  731.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "上年结转"
  732.     
  733.     '输出余额
  734.     Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  735.     
  736.     
  737.     '2.读出所有会计期间记账数据
  738.     Sqlstr = "SELECT Period,Mjjehj=Isnull(SUM(Mjje),0), Mdjehj=Isnull(SUM(Mdje),0), Mjslhj=Isnull(SUM(Mjsl),0), Mdslhj=Isnull(SUM(Mdsl),0)," & _
  739.     " Mjwbhj=Isnull(SUM(Mjwb),0), Mdwbhj=Isnull(SUM(Mdwb),0) From Cwzz_AccSumAssi Where Ccode like '" & Str_Ccode & "%'  And CusCode='" & Str_FzCode & "' And Year=" & Int_Year & _
  740.     " GROUP BY Period"
  741.     Set Rec_AccSum = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  742.     
  743.     '3.如果包含未记帐凭证查询,则读出本年度所有未记帐凭证各会计期间合计数据
  744.     If Bln_IncluNotBook Then
  745.         Sqlstr = "SELECT Period,Jfjehj=Isnull(SUM(Jfje),0),Dfjehj=Isnull(SUM(Dfje),0),Jfslhj=Isnull(SUM(Jfsl),0),Dfslhj=Isnull(SUM(Dfsl),0)," & _
  746.         " Wbjfjehj=Isnull(SUM(Wbjfje),0),Wbdfjehj=Isnull(SUM(Wbdfje),0) From Cwzz_V_AccVouch WHERE BookFlag=0 And Ccode like '" & Str_Ccode & "%'  And CusCode='" & Str_FzCode & "' And Year=" & Int_Year & _
  747.         " GROUP BY Period"
  748.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  749.     End If
  750.     
  751.     '4.将各会计期间科目合计数据写入网格,同时计算本年累计,余额将其写入网格
  752.     For Int_DqPeriod = 1 To 12
  753.         
  754.         '本期合计数据清零
  755.         Dbl_Jejfhj = 0
  756.         Dbl_Jedfhj = 0
  757.         Dbl_Sljfhj = 0
  758.         Dbl_Sldfhj = 0
  759.         Dbl_Wbjfhj = 0
  760.         Dbl_Wbdfhj = 0
  761.         
  762.         With Rec_AccSum
  763.             If .RecordCount <> 0 Then
  764.                 .MoveFirst
  765.                 .Find "Period =" & Int_DqPeriod
  766.                 If Not .EOF Then
  767.                     Dbl_Jejfhj = Dbl_Jejfhj + .Fields("Mjjehj")
  768.                     Dbl_Jedfhj = Dbl_Jedfhj + .Fields("Mdjehj")
  769.                     Dbl_Sljfhj = Dbl_Sljfhj + .Fields("Mjslhj")
  770.                     Dbl_Sldfhj = Dbl_Sldfhj + .Fields("Mdslhj")
  771.                     Dbl_Wbjfhj = Dbl_Wbjfhj + .Fields("Mjwbhj")
  772.                     Dbl_Wbdfhj = Dbl_Wbdfhj + .Fields("Mdwbhj")
  773.                     
  774.                     Dbl_Jejflj = Dbl_Jejflj + .Fields("Mjjehj")
  775.                     Dbl_Jedflj = Dbl_Jedflj + .Fields("Mdjehj")
  776.                     Dbl_Sljflj = Dbl_Sljflj + .Fields("Mjslhj")
  777.                     Dbl_Sldflj = Dbl_Sldflj + .Fields("Mdslhj")
  778.                     Dbl_Wbjflj = Dbl_Wbjflj + .Fields("Mjwbhj")
  779.                     Dbl_Wbdflj = Dbl_Wbdflj + .Fields("Mdwbhj")
  780.                 End If
  781.             End If
  782.         End With
  783.         
  784.         '判断是否包含未记帐凭证
  785.         If Bln_IncluNotBook Then
  786.             With RecTemp
  787.                 If .RecordCount <> 0 Then
  788.                     .MoveFirst
  789.                     .Find "Period =" & Int_DqPeriod
  790.                     If Not .EOF Then
  791.                         Dbl_Jejfhj = Dbl_Jejfhj + .Fields("Jfjehj")
  792.                         Dbl_Jedfhj = Dbl_Jedfhj + .Fields("Dfjehj")
  793.                         Dbl_Sljfhj = Dbl_Sljfhj + .Fields("Jfslhj")
  794.                         Dbl_Sldfhj = Dbl_Sldfhj + .Fields("Dfslhj")
  795.                         Dbl_Wbjfhj = Dbl_Wbjfhj + .Fields("Wbjfjehj")
  796.                         Dbl_Wbdfhj = Dbl_Wbdfhj + .Fields("Wbdfjehj")
  797.                         
  798.                         Dbl_Jejflj = Dbl_Jejflj + .Fields("Jfjehj")
  799.                         Dbl_Jedflj = Dbl_Jedflj + .Fields("Dfjehj")
  800.                         Dbl_Sljflj = Dbl_Sljflj + .Fields("Jfslhj")
  801.                         Dbl_Sldflj = Dbl_Sldflj + .Fields("Dfslhj")
  802.                         Dbl_Wbjflj = Dbl_Wbjflj + .Fields("Wbjfjehj")
  803.                         Dbl_Wbdflj = Dbl_Wbdflj + .Fields("Wbdfjehj")
  804.                     End If
  805.                 End If
  806.             End With
  807.         End If
  808.         
  809.         '随时计算期末余额
  810.         
  811.         Dbl_Qcyete = Dbl_Qcyete + Dbl_Jejfhj - Dbl_Jedfhj
  812.         Dbl_Qcslte = Dbl_Qcslte + Dbl_Sljfhj - Dbl_Sldfhj
  813.         Dbl_Qcwbte = Dbl_Qcwbte + Dbl_Wbjfhj - Dbl_Wbdfhj
  814.         
  815.         '如果本期合计数据不为零则输出本月合计,本年累计,期末余额
  816.         If Dbl_Jejfhj <> 0 Or Dbl_Jedfhj <> 0 Or Dbl_Sljfhj <> 0 Or Dbl_Sldfhj <> 0 Or Dbl_Wbjfhj <> 0 Or Dbl_Wbdfhj <> 0 Then
  817.             CxbbGrid.AddItem ""
  818.             Jsqte = Jsqte + 1
  819.             Call Sub_OutPeriodSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejfhj, Dbl_Jedfhj, Dbl_Sljfhj, Dbl_Sldfhj, Dbl_Wbjfhj, Dbl_Wbdfhj)
  820.             
  821.             '输出余额
  822.             Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  823.             
  824.             CxbbGrid.AddItem ""
  825.             Jsqte = Jsqte + 1
  826.             Call Sub_OutYearSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejflj, Dbl_Jedflj, Dbl_Sljflj, Dbl_Sldflj, Dbl_Wbjflj, Dbl_Wbdflj)
  827.         End If
  828.         
  829.     Next Int_DqPeriod
  830.     
  831.     '重置网格行高
  832.     For Jsqte = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  833.         CxbbGrid.RowHeight(Jsqte) = Sjhgd
  834.     Next Jsqte
  835.     
  836. End Sub
  837. Private Sub Combo_AccFormat_Click()                    '用户选择不同帐页格式
  838.     Dim Int_Coljsq As Integer         '网格列临时计数器
  839.     
  840.     '为了加快显示速度
  841.     CxbbGrid.Redraw = False
  842.     
  843.     For Int_Coljsq = Qslz To CxbbGrid.Cols - 1
  844.         CxbbGrid.ColHidden(Int_Coljsq) = True
  845.     Next Int_Coljsq
  846.     
  847.     Select Case Combo_AccFormat
  848.     Case "金额式"
  849.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  850.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  851.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  852.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  853.         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False      '借方.借方
  854.         CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False      '贷方.贷方
  855.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  856.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '余额.余额
  857.         
  858.     Case "外币金额式"
  859.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  860.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  861.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  862.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  863.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '借方.外币
  864.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.金额
  865.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '贷方.外币
  866.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.金额
  867.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  868.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '余额.外币
  869.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.金额
  870.         
  871.     Case "数量金额式"
  872.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  873.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  874.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  875.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  876.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '借方.数量
  877.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.金额
  878.         CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False      '贷方.数量
  879.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.金额
  880.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  881.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '余额.数量
  882.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.金额
  883.         
  884.     Case "数量外币式"
  885.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  886.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  887.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  888.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  889.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '借方.数量
  890.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '借方.外币
  891.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.金额
  892.         CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False      '贷方.数量
  893.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '贷方.外币
  894.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.金额
  895.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  896.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '余额.数量
  897.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '余额.外币
  898.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.金额
  899.         
  900.     End Select
  901.     CxbbGrid.Redraw = True
  902. End Sub
  903. Private Sub Sub_OutBalance(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#)          '输出余额
  904.     If Dbl_Qcyete = 0 Then
  905.         CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = "平"          '期初方向
  906.         If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  907.             CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Qcslte
  908.         End If
  909.         If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  910.             CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Dbl_Qcwbte
  911.         End If
  912.     Else
  913.         If Dbl_Qcyete > 0 Then
  914.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = "借"
  915.             CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Dbl_Qcyete
  916.             CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Dbl_Qcyete
  917.             If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  918.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Qcslte
  919.             End If
  920.             If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  921.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Dbl_Qcwbte
  922.             End If
  923.         Else
  924.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = "贷"
  925.             CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = -Dbl_Qcyete
  926.             CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = -Dbl_Qcyete
  927.             If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  928.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = -Dbl_Qcslte
  929.             End If
  930.             If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  931.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = -Dbl_Qcwbte
  932.             End If
  933.         End If
  934.     End If
  935. End Sub
  936. Private Sub Sub_OutPeriodSum(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Int_DqPeriod%, Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj#)  '输出本月合计
  937.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  938.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "本月合计"
  939.     If Dbl_Jejfhj <> 0 Then                                                        '本月借方金额合计
  940.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Dbl_Jejfhj
  941.         CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Jejfhj
  942.     End If
  943.     If Dbl_Jedfhj <> 0 Then                                                        '本月贷方金额合计
  944.         CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jedfhj
  945.         CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Jedfhj
  946.     End If
  947.     
  948.     '只有末级科目才显示数量和外币
  949.     If Bln_EndFlag Then
  950.         If Dbl_Sljfhj <> 0 Then                                                     '本月借方数量合计
  951.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Sljfhj
  952.         End If
  953.         If Dbl_Sldfhj <> 0 Then                                                     '本月贷方数量合计
  954.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Sldfhj
  955.         End If
  956.     End If
  957.     
  958.     If Bln_EndFlag And Bln_ForeignFlag Then
  959.         If Dbl_Wbjfhj <> 0 Then                                                     '本月借方外币合计
  960.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Wbjfhj
  961.         End If
  962.         If Dbl_Wbdfhj <> 0 Then                                                     '本月贷方外币合计
  963.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Wbdfhj
  964.         End If
  965.     End If
  966. End Sub
  967. Private Sub Sub_OutYearSum(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Int_DqPeriod%, Dbl_Jejflj#, Dbl_Jedflj#, Dbl_Sljflj#, Dbl_Sldflj#, Dbl_Wbjflj#, Dbl_Wbdflj#)  '输出本年累计
  968.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  969.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "本年累计"
  970.     If Dbl_Jejflj <> 0 Then                                                        '本年借方金额累计
  971.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Dbl_Jejflj
  972.         CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Jejflj
  973.     End If
  974.     If Dbl_Jedflj <> 0 Then                                                        '本年贷方金额累计
  975.         CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jedflj
  976.         CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Jedflj
  977.     End If
  978.     
  979.     '只有末级科目才显示数量和外币
  980.     If Bln_EndFlag Then
  981.         If Dbl_Sljflj <> 0 Then                                                     '本年借方数量累计
  982.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Sljflj
  983.         End If
  984.         If Dbl_Sldflj <> 0 Then                                                     '本年贷方数量累计
  985.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Sldflj
  986.         End If
  987.     End If
  988.     
  989.     If Bln_EndFlag And Bln_ForeignFlag Then
  990.         If Dbl_Wbjflj <> 0 Then                                                     '本年借方外币累计
  991.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Wbjflj
  992.         End If
  993.         If Dbl_Wbdflj <> 0 Then                                                     '本年贷方外币累计
  994.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Wbdflj
  995.         End If
  996.     End If
  997. End Sub
  998. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  999.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1000.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1001.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1002.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1003.     ReDim Bbxbt(1 To Bbxbtgs)
  1004.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1005.     If Bbbwhgs <> 0 Then
  1006.         ReDim Bbbwh(1 To Bbbwhgs)
  1007.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1008.     End If
  1009.     Bbzbt = ReportTitle
  1010.     'Bbxbt(1) = Space(2) + "科目名称:" + Me.Imgebo_FzCcode.Text + Space(5) + "客户:" + Me.Imgebo_FzCode.Text
  1011.     Bbxbt(1) = Space(2) + "科目名称:" + Me.Imgebo_FzCcode.Text + Space(5) + "客户:" + Me.Imgebo_FzCode.Text
  1012.     bbxbtzzxs(1) = 0                                    '报表行组织形式(0-居左 1-居中 2-居右)
  1013.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1014.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1015.     If Not bbylte Then
  1016.         Unload DY_Tybbyldy
  1017.     End If
  1018. End Sub