上传用户: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_Gys_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            =   6120
  84.          TabIndex        =   10
  85.          Top             =   840
  86.          Width           =   645
  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            =   500
  137.          TabIndex        =   1
  138.          Top             =   150
  139.          Width           =   2775
  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_Gys_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_gys_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_gys_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.     
  551. End Sub
  552. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  553.     '卸载条件窗体
  554.     ZF_Gys_Frmslzztj.UnloadCheck.Value = 1
  555.     Unload ZF_Gys_Frmslzztj
  556.     '卸载打印页面设置窗体
  557.     Unload Dyymctbl
  558. End Sub
  559. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  560.     Select Case Button.Key
  561.     Case "bcgs"                                          '保存表格格式
  562.         Call Bcwggs(CxbbGrid, GridCode, GridStr)
  563.     Case "hfmrgs"                                        '恢复默认格式
  564.         Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  565.     Case "szxsxm"                                        '设置显示项目
  566.         Call Szxsxm(CxbbGrid, GridCode)
  567.     End Select
  568. End Sub
  569. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  570.     Select Case Button.Key
  571.     Case "ymsz"                                          '页面设置
  572.         Dyymctbl.Show 1
  573.     Case "yl"                                            '预 览
  574.         Call bbyl(True)
  575.     Case "dy"                                            '打 印
  576.         Call bbyl(False)
  577.     Case "cx"                                            '查 询
  578.         ZF_Gys_Frmslzztj.Show 1
  579.     Case "bz"                                            '帮 助
  580.         Call F1bz
  581.     Case "fh"                                            '退 出
  582.         Unload Me
  583.     End Select
  584. End Sub
  585. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  586.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  587.     Dim Str_QueryCondi As String                '用户录入查询条件
  588.     
  589.     Timer1.Enabled = False
  590.     
  591.     With ZF_Gys_Frmslzztj
  592.         '辅助查询科目
  593.         Call FillImageCombo(Imgebo_FzCcode, "Cwzz_gyswlkm", 0)
  594.         
  595.         For Jsqte = 1 To Imgebo_FzCcode.ComboItems.count
  596.             If Imgebo_FzCcode.ComboItems.Item(Jsqte).Text = ZF_Gys_Frmslzztj.Imgebo_FzCcode.Text Then
  597.                 Imgebo_FzCcode.ComboItems.Item(Jsqte).Selected = True
  598.                 Imgebo_FzCcode.Refresh
  599.                 Exit For
  600.             End If
  601.         Next Jsqte
  602.         
  603.         '查询供应商
  604.         Call FillImageCombo(Imgebo_FzCode, "Cwzz_supplier", 0)
  605.         For Jsqte = 1 To Imgebo_FzCode.ComboItems.count
  606.             If Imgebo_FzCode.ComboItems.Item(Jsqte).Key = "@" + Trim(ZF_Gys_Frmslzztj.LrText(0).Tag) Then
  607.                 Imgebo_FzCode.ComboItems.Item(Jsqte).Selected = True
  608.                 Imgebo_FzCode.Refresh
  609.                 Exit For
  610.             End If
  611.         Next Jsqte
  612.     End With
  613.     
  614.     '生成查询结果
  615.     Call Sub_ScQuery
  616.     
  617. End Sub
  618. Private Sub Imgebo_FzCcode_Click()                        '点击科目列表
  619.     Call Sub_ScQuery
  620. End Sub
  621. Private Sub Imgebo_FzCode_Click()                         '点击辅助供应商列表
  622.     Call Sub_ScQuery
  623. End Sub
  624. Private Sub Sub_ScQuery()                                 '生成查询结果
  625.     Xt_Wait.Show
  626.     Xt_Wait.Refresh
  627.     CxbbGrid.Redraw = True
  628.     
  629.     '加快显示速度
  630.     CxbbGrid.Redraw = False
  631.     
  632.     '生成查询结果
  633.     Call Sub_Query
  634.     
  635.     CxbbGrid.Redraw = True
  636.     
  637.     Xt_Wait.Hide
  638. End Sub
  639. Private Sub Sub_Query()                                    '生成查询结果
  640.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  641.     Dim Rec_AccSum As New ADODB.Recordset       '科目总帐动态集
  642.     Dim Str_Ccode As String                     '查询科目
  643.     Dim Str_FzCode As String                    '查询辅助供应商编码
  644.     Dim Sqlstr As String                        '查询字符串
  645.     Dim Coljsq As Long                          '网格列计数器
  646.     Dim Jsqte As Long                           '临时动态计数器
  647.     Dim Int_Year As Integer                     '查询会计年度
  648.     Dim Bln_IncluNotBook As Boolean             '是否包含未记帐凭证
  649.     Dim Bln_EndFlag As Boolean                  '判断当前科目是否为末级科目
  650.     Dim Bln_ForeignFlag As Boolean              '判断此科目是否外币核算
  651.     Dim Int_DqPeriod As Integer                 '查询进行当前会计期间
  652.     
  653.     Dim Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#   '期初金额,数量,外币
  654.     Dim Dbl_Jejfhj#, Dbl_Jedfhj#, Dbl_Sljfhj#, Dbl_Sldfhj#, Dbl_Wbjfhj#, Dbl_Wbdfhj# '本期合计(金额,数量,外币)
  655.     Dim Dbl_Jejflj#, Dbl_Jedflj#, Dbl_Sljflj#, Dbl_Sldflj#, Dbl_Wbjflj#, Dbl_Wbdflj# '截止累计(金额,数量,外币)
  656.     Dim Dbl_Qmyete#, Dbl_Qmslte#, Dbl_Qmwbte#   '期末金额,数量,外币
  657.     '以下为用户自定义部分[
  658.     
  659.     '清除原查询数据
  660.     CxbbGrid.Rows = CxbbGrid.FixedRows
  661.     
  662.     '得到当前查询科目,并判断是否为末级科目
  663.     Str_Ccode = GetComboKey(Imgebo_FzCcode, 0)
  664.     Sqlstr = "SELECT EndFlag,AccFormat,ForeignFlag,ForeignCurrName,ConVertFlag From Cwzz_AccCode Left JOIN Gy_ForeignCurrency ON" & _
  665.     " Cwzz_AccCode.ForeignCurrCode = Gy_ForeignCurrency.ForeignCurrCode Where Ccode='" & Str_Ccode & "'"
  666.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  667.     If Not RecTemp.EOF Then
  668.         Bln_EndFlag = RecTemp.Fields("EndFlag")
  669.         Combo_AccFormat.Text = Trim(RecTemp.Fields("AccFormat") & "")
  670.         If RecTemp.Fields("ForeignFlag") Then
  671.             Lab_TitleMess(2).Visible = True
  672.             Lab_TitleText(1).Caption = Trim(RecTemp.Fields("ForeignCurrName") & "")
  673.             Bln_ForeignFlag = True
  674.             Bln_ConVertFlag = IIf(IsNull(RecTemp.Fields("ConVertFlag")), False, RecTemp.Fields("ConVertFlag"))
  675.         Else
  676.             Lab_TitleMess(2).Visible = False
  677.             Bln_ForeignFlag = False
  678.             Lab_TitleText(1).Caption = ""
  679.         End If
  680.     End If
  681.     
  682.     '得到查询辅助供应商编码
  683.     Str_FzCode = GetComboKey(Imgebo_FzCode, 0)
  684.     
  685.     '得到查询年度,并判断是否包含未记帐凭证
  686.     With ZF_Gys_Frmslzztj
  687.         
  688.         Int_Year = Xtyear
  689.         
  690.         '是否包含未记帐凭证
  691.         If .Chk_NotBook.Value = 1 Then
  692.             Bln_IncluNotBook = True
  693.         Else
  694.             Bln_IncluNotBook = False
  695.         End If
  696.         
  697.     End With
  698.     
  699.     '初始化各种值
  700.     Dbl_Qcyete = 0
  701.     Dbl_Qcslte = 0
  702.     Dbl_Qcwbte = 0
  703.     
  704.     Dbl_Jejfhj = 0
  705.     Dbl_Jedfhj = 0
  706.     Dbl_Sljfhj = 0
  707.     Dbl_Sldfhj = 0
  708.     Dbl_Wbjfhj = 0
  709.     Dbl_Wbdfhj = 0
  710.     
  711.     Dbl_Jejflj = 0
  712.     Dbl_Jedflj = 0
  713.     Dbl_Sljflj = 0
  714.     Dbl_Sldflj = 0
  715.     Dbl_Wbjflj = 0
  716.     Dbl_Wbdflj = 0
  717.     
  718.     Jsqte = CxbbGrid.FixedRows - 1
  719.     
  720.     '1.读出上年结转余额(数量,外币,金)
  721.     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 SupplierCode='" & Str_FzCode & "'And Year=" & Int_Year & " And Period=1"
  722.     Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  723.     If Not RecTemp.EOF Then
  724.         Dbl_Qcyete = RecTemp.Fields("Qcyehj")
  725.         Dbl_Qcslte = RecTemp.Fields("Qcslhj")
  726.         Dbl_Qcwbte = RecTemp.Fields("Qcwbhj")
  727.     End If
  728.     
  729.     CxbbGrid.AddItem ""
  730.     Jsqte = Jsqte + 1
  731.     
  732.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "上年结转"
  733.     
  734.     '输出余额
  735.     Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  736.     
  737.     
  738.     '2.读出所有会计期间记账数据
  739.     Sqlstr = "SELECT Period,Mjjehj=Isnull(SUM(Mjje),0), Mdjehj=Isnull(SUM(Mdje),0), Mjslhj=Isnull(SUM(Mjsl),0), Mdslhj=Isnull(SUM(Mdsl),0)," & _
  740.     " Mjwbhj=Isnull(SUM(Mjwb),0), Mdwbhj=Isnull(SUM(Mdwb),0) From Cwzz_AccSumAssi Where Ccode like '" & Str_Ccode & "%'  And SupplierCode='" & Str_FzCode & "' And Year=" & Int_Year & _
  741.     " GROUP BY Period"
  742.     Set Rec_AccSum = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  743.     
  744.     '3.如果包含未记帐凭证查询,则读出本年度所有未记帐凭证各会计期间合计数据
  745.     If Bln_IncluNotBook Then
  746.         Sqlstr = "SELECT Period,Jfjehj=Isnull(SUM(Jfje),0),Dfjehj=Isnull(SUM(Dfje),0),Jfslhj=Isnull(SUM(Jfsl),0),Dfslhj=Isnull(SUM(Dfsl),0)," & _
  747.         " Wbjfjehj=Isnull(SUM(Wbjfje),0),Wbdfjehj=Isnull(SUM(Wbdfje),0) From Cwzz_V_AccVouch WHERE BookFlag=0 And Ccode like '" & Str_Ccode & "%'  And SupplierCode='" & Str_FzCode & "' And Year=" & Int_Year & _
  748.         " GROUP BY Period"
  749.         Set RecTemp = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  750.     End If
  751.     
  752.     '4.将各会计期间科目合计数据写入网格,同时计算本年累计,余额将其写入网格
  753.     For Int_DqPeriod = 1 To 12
  754.         
  755.         '本期合计数据清零
  756.         Dbl_Jejfhj = 0
  757.         Dbl_Jedfhj = 0
  758.         Dbl_Sljfhj = 0
  759.         Dbl_Sldfhj = 0
  760.         Dbl_Wbjfhj = 0
  761.         Dbl_Wbdfhj = 0
  762.         
  763.         With Rec_AccSum
  764.             If .RecordCount <> 0 Then
  765.                 .MoveFirst
  766.                 .Find "Period =" & Int_DqPeriod
  767.                 If Not .EOF Then
  768.                     Dbl_Jejfhj = Dbl_Jejfhj + .Fields("Mjjehj")
  769.                     Dbl_Jedfhj = Dbl_Jedfhj + .Fields("Mdjehj")
  770.                     Dbl_Sljfhj = Dbl_Sljfhj + .Fields("Mjslhj")
  771.                     Dbl_Sldfhj = Dbl_Sldfhj + .Fields("Mdslhj")
  772.                     Dbl_Wbjfhj = Dbl_Wbjfhj + .Fields("Mjwbhj")
  773.                     Dbl_Wbdfhj = Dbl_Wbdfhj + .Fields("Mdwbhj")
  774.                     
  775.                     Dbl_Jejflj = Dbl_Jejflj + .Fields("Mjjehj")
  776.                     Dbl_Jedflj = Dbl_Jedflj + .Fields("Mdjehj")
  777.                     Dbl_Sljflj = Dbl_Sljflj + .Fields("Mjslhj")
  778.                     Dbl_Sldflj = Dbl_Sldflj + .Fields("Mdslhj")
  779.                     Dbl_Wbjflj = Dbl_Wbjflj + .Fields("Mjwbhj")
  780.                     Dbl_Wbdflj = Dbl_Wbdflj + .Fields("Mdwbhj")
  781.                 End If
  782.             End If
  783.         End With
  784.         
  785.         '判断是否包含未记帐凭证
  786.         If Bln_IncluNotBook Then
  787.             With RecTemp
  788.                 If .RecordCount <> 0 Then
  789.                     .MoveFirst
  790.                     .Find "Period =" & Int_DqPeriod
  791.                     If Not .EOF Then
  792.                         Dbl_Jejfhj = Dbl_Jejfhj + .Fields("Jfjehj")
  793.                         Dbl_Jedfhj = Dbl_Jedfhj + .Fields("Dfjehj")
  794.                         Dbl_Sljfhj = Dbl_Sljfhj + .Fields("Jfslhj")
  795.                         Dbl_Sldfhj = Dbl_Sldfhj + .Fields("Dfslhj")
  796.                         Dbl_Wbjfhj = Dbl_Wbjfhj + .Fields("Wbjfjehj")
  797.                         Dbl_Wbdfhj = Dbl_Wbdfhj + .Fields("Wbdfjehj")
  798.                         
  799.                         Dbl_Jejflj = Dbl_Jejflj + .Fields("Jfjehj")
  800.                         Dbl_Jedflj = Dbl_Jedflj + .Fields("Dfjehj")
  801.                         Dbl_Sljflj = Dbl_Sljflj + .Fields("Jfslhj")
  802.                         Dbl_Sldflj = Dbl_Sldflj + .Fields("Dfslhj")
  803.                         Dbl_Wbjflj = Dbl_Wbjflj + .Fields("Wbjfjehj")
  804.                         Dbl_Wbdflj = Dbl_Wbdflj + .Fields("Wbdfjehj")
  805.                     End If
  806.                 End If
  807.             End With
  808.         End If
  809.         
  810.         '随时计算期末余额
  811.         
  812.         Dbl_Qcyete = Dbl_Qcyete + Dbl_Jejfhj - Dbl_Jedfhj
  813.         Dbl_Qcslte = Dbl_Qcslte + Dbl_Sljfhj - Dbl_Sldfhj
  814.         Dbl_Qcwbte = Dbl_Qcwbte + Dbl_Wbjfhj - Dbl_Wbdfhj
  815.         
  816.         '如果本期合计数据不为零则输出本月合计,本年累计,期末余额
  817.         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
  818.             CxbbGrid.AddItem ""
  819.             Jsqte = Jsqte + 1
  820.             Call Sub_OutPeriodSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejfhj, Dbl_Jedfhj, Dbl_Sljfhj, Dbl_Sldfhj, Dbl_Wbjfhj, Dbl_Wbdfhj)
  821.             
  822.             '输出余额
  823.             Call Sub_OutBalance(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Dbl_Qcyete, Dbl_Qcslte, Dbl_Qcwbte)
  824.             
  825.             CxbbGrid.AddItem ""
  826.             Jsqte = Jsqte + 1
  827.             Call Sub_OutYearSum(Jsqte, Bln_EndFlag, Bln_ForeignFlag, Int_DqPeriod, Dbl_Jejflj, Dbl_Jedflj, Dbl_Sljflj, Dbl_Sldflj, Dbl_Wbjflj, Dbl_Wbdflj)
  828.         End If
  829.         
  830.     Next Int_DqPeriod
  831.     
  832.     '重置网格行高
  833.     For Jsqte = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  834.         CxbbGrid.RowHeight(Jsqte) = Sjhgd
  835.     Next Jsqte
  836.     
  837. End Sub
  838. Private Sub Combo_AccFormat_Click()                    '用户选择不同帐页格式
  839.     Dim Int_Coljsq As Integer         '网格列临时计数器
  840.     
  841.     '为了加快显示速度
  842.     CxbbGrid.Redraw = False
  843.     
  844.     For Int_Coljsq = Qslz To CxbbGrid.Cols - 1
  845.         CxbbGrid.ColHidden(Int_Coljsq) = True
  846.     Next Int_Coljsq
  847.     
  848.     Select Case Combo_AccFormat
  849.     Case "金额式"
  850.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  851.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  852.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  853.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  854.         CxbbGrid.ColHidden(Sydz("005", GridStr(), Szzls)) = False      '借方.借方
  855.         CxbbGrid.ColHidden(Sydz("009", GridStr(), Szzls)) = False      '贷方.贷方
  856.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  857.         CxbbGrid.ColHidden(Sydz("014", GridStr(), Szzls)) = False      '余额.余额
  858.         
  859.     Case "外币金额式"
  860.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  861.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  862.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  863.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  864.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '借方.外币
  865.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.金额
  866.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '贷方.外币
  867.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.金额
  868.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  869.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '余额.外币
  870.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.金额
  871.         
  872.     Case "数量金额式"
  873.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  874.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  875.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  876.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  877.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '借方.数量
  878.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.金额
  879.         CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False      '贷方.数量
  880.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.金额
  881.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  882.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '余额.数量
  883.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.金额
  884.         
  885.     Case "数量外币式"
  886.         CxbbGrid.ColHidden(Sydz("001", GridStr(), Szzls)) = False      '月
  887.         CxbbGrid.ColHidden(Sydz("002", GridStr(), Szzls)) = False      '日
  888.         CxbbGrid.ColHidden(Sydz("003", GridStr(), Szzls)) = False      '凭证字号
  889.         CxbbGrid.ColHidden(Sydz("004", GridStr(), Szzls)) = False      '摘要
  890.         CxbbGrid.ColHidden(Sydz("006", GridStr(), Szzls)) = False      '借方.数量
  891.         CxbbGrid.ColHidden(Sydz("007", GridStr(), Szzls)) = False      '借方.外币
  892.         CxbbGrid.ColHidden(Sydz("008", GridStr(), Szzls)) = False      '借方.金额
  893.         CxbbGrid.ColHidden(Sydz("010", GridStr(), Szzls)) = False      '贷方.数量
  894.         CxbbGrid.ColHidden(Sydz("011", GridStr(), Szzls)) = False      '贷方.外币
  895.         CxbbGrid.ColHidden(Sydz("012", GridStr(), Szzls)) = False      '贷方.金额
  896.         CxbbGrid.ColHidden(Sydz("013", GridStr(), Szzls)) = False      '方向.方向
  897.         CxbbGrid.ColHidden(Sydz("015", GridStr(), Szzls)) = False      '余额.数量
  898.         CxbbGrid.ColHidden(Sydz("016", GridStr(), Szzls)) = False      '余额.外币
  899.         CxbbGrid.ColHidden(Sydz("017", GridStr(), Szzls)) = False      '余额.金额
  900.         
  901.     End Select
  902.     CxbbGrid.Redraw = True
  903. End Sub
  904. Private Sub Sub_OutBalance(Jsqte As Long, Bln_EndFlag As Boolean, Bln_ForeignFlag As Boolean, Dbl_Qcyete#, Dbl_Qcslte#, Dbl_Qcwbte#)          '输出余额
  905.     If Dbl_Qcyete = 0 Then
  906.         CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = "平"          '期初方向
  907.         If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  908.             CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Qcslte
  909.         End If
  910.         If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  911.             CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Dbl_Qcwbte
  912.         End If
  913.     Else
  914.         If Dbl_Qcyete > 0 Then
  915.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = "借"
  916.             CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Dbl_Qcyete
  917.             CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = Dbl_Qcyete
  918.             If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  919.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Dbl_Qcslte
  920.             End If
  921.             If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  922.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Dbl_Qcwbte
  923.             End If
  924.         Else
  925.             CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = "贷"
  926.             CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = -Dbl_Qcyete
  927.             CxbbGrid.TextMatrix(Jsqte, Sydz("017", GridStr(), Szzls)) = -Dbl_Qcyete
  928.             If Bln_EndFlag And Dbl_Qcslte <> 0 Then
  929.                 CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = -Dbl_Qcslte
  930.             End If
  931.             If Bln_EndFlag And Bln_ForeignFlag And Dbl_Qcwbte <> 0 Then
  932.                 CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = -Dbl_Qcwbte
  933.             End If
  934.         End If
  935.     End If
  936. End Sub
  937. 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#)  '输出本月合计
  938.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  939.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "本月合计"
  940.     If Dbl_Jejfhj <> 0 Then                                                        '本月借方金额合计
  941.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Dbl_Jejfhj
  942.         CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Jejfhj
  943.     End If
  944.     If Dbl_Jedfhj <> 0 Then                                                        '本月贷方金额合计
  945.         CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jedfhj
  946.         CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Jedfhj
  947.     End If
  948.     
  949.     '只有末级科目才显示数量和外币
  950.     If Bln_EndFlag Then
  951.         If Dbl_Sljfhj <> 0 Then                                                     '本月借方数量合计
  952.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Sljfhj
  953.         End If
  954.         If Dbl_Sldfhj <> 0 Then                                                     '本月贷方数量合计
  955.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Sldfhj
  956.         End If
  957.     End If
  958.     
  959.     If Bln_EndFlag And Bln_ForeignFlag Then
  960.         If Dbl_Wbjfhj <> 0 Then                                                     '本月借方外币合计
  961.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Wbjfhj
  962.         End If
  963.         If Dbl_Wbdfhj <> 0 Then                                                     '本月贷方外币合计
  964.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Wbdfhj
  965.         End If
  966.     End If
  967. End Sub
  968. 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#)  '输出本年累计
  969.     CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Mid(Trim(Str(100 + Int_DqPeriod)), 2, 2)
  970.     CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = "本年累计"
  971.     If Dbl_Jejflj <> 0 Then                                                        '本年借方金额累计
  972.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Dbl_Jejflj
  973.         CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Dbl_Jejflj
  974.     End If
  975.     If Dbl_Jedflj <> 0 Then                                                        '本年贷方金额累计
  976.         CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = Dbl_Jedflj
  977.         CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Dbl_Jedflj
  978.     End If
  979.     
  980.     '只有末级科目才显示数量和外币
  981.     If Bln_EndFlag Then
  982.         If Dbl_Sljflj <> 0 Then                                                     '本年借方数量累计
  983.             CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Dbl_Sljflj
  984.         End If
  985.         If Dbl_Sldflj <> 0 Then                                                     '本年贷方数量累计
  986.             CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Dbl_Sldflj
  987.         End If
  988.     End If
  989.     
  990.     If Bln_EndFlag And Bln_ForeignFlag Then
  991.         If Dbl_Wbjflj <> 0 Then                                                     '本年借方外币累计
  992.             CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Dbl_Wbjflj
  993.         End If
  994.         If Dbl_Wbdflj <> 0 Then                                                     '本年贷方外币累计
  995.             CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Dbl_Wbdflj
  996.         End If
  997.     End If
  998. End Sub
  999. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  1000.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  1001.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  1002.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  1003.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  1004.     ReDim Bbxbt(1 To Bbxbtgs)
  1005.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  1006.     If Bbbwhgs <> 0 Then
  1007.         ReDim Bbbwh(1 To Bbbwhgs)
  1008.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  1009.     End If
  1010.     Bbzbt = ReportTitle
  1011.     'Bbxbt(1) = Space(2) + "科目名称:" + Me.Imgebo_FzCcode.Text + Space(5) + "供应商:" + Me.Imgebo_FzCode.Text
  1012.     Bbxbt(1) = Space(2) + "科目名称:" + Me.Imgebo_FzCcode.Text + Space(5) + "供应商:" + Me.Imgebo_FzCode.Text
  1013.     bbxbtzzxs(1) = 0                                    '报表行组织形式(0-居左 1-居中 2-居右)
  1014.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  1015.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  1016.     If Not bbylte Then
  1017.         Unload DY_Tybbyldy
  1018.     End If
  1019. End Sub