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

企业管理

开发平台:

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 Bbfx_FrmIncFx 
  5.    Caption         =   "损益表分析"
  6.    ClientHeight    =   7095
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   9375
  10.    Icon            =   "报表分析_损益表分析.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   7095
  15.    ScaleWidth      =   9375
  16.    Begin VB.PictureBox Pic_Title 
  17.       Height          =   1020
  18.       Left            =   -30
  19.       Picture         =   "报表分析_损益表分析.frx":1042
  20.       ScaleHeight     =   960
  21.       ScaleWidth      =   9345
  22.       TabIndex        =   1
  23.       Top             =   570
  24.       Width           =   9405
  25.       Begin VB.Label lab_bj 
  26.          AutoSize        =   -1  'True
  27.          BackStyle       =   0  'Transparent
  28.          Caption         =   "------"
  29.          Height          =   180
  30.          Left            =   3705
  31.          TabIndex        =   9
  32.          Top             =   765
  33.          Width           =   540
  34.       End
  35.       Begin VB.Label lab_fx 
  36.          AutoSize        =   -1  'True
  37.          BackStyle       =   0  'Transparent
  38.          Caption         =   "------"
  39.          Height          =   180
  40.          Left            =   555
  41.          TabIndex        =   8
  42.          Top             =   750
  43.          Width           =   540
  44.       End
  45.       Begin VB.Label lab_Bjq 
  46.          AutoSize        =   -1  'True
  47.          BackStyle       =   0  'Transparent
  48.          Caption         =   "到:"
  49.          Height          =   195
  50.          Left            =   3345
  51.          TabIndex        =   7
  52.          Top             =   750
  53.          Width           =   225
  54.       End
  55.       Begin VB.Label lab_Fxq 
  56.          AutoSize        =   -1  'True
  57.          BackStyle       =   0  'Transparent
  58.          Caption         =   "从:"
  59.          Height          =   195
  60.          Left            =   225
  61.          TabIndex        =   6
  62.          Top             =   750
  63.          Width           =   225
  64.       End
  65.       Begin VB.Label Label_Bfb 
  66.          AutoSize        =   -1  'True
  67.          BackStyle       =   0  'Transparent
  68.          Caption         =   "单位:百分比"
  69.          Height          =   195
  70.          Left            =   6855
  71.          TabIndex        =   5
  72.          Top             =   720
  73.          Visible         =   0   'False
  74.          Width           =   945
  75.       End
  76.       Begin VB.Label TsLabel 
  77.          AutoSize        =   -1  'True
  78.          BackColor       =   &H80000018&
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "损益表分析"
  81.          BeginProperty Font 
  82.             Name            =   "宋体"
  83.             Size            =   12
  84.             Charset         =   134
  85.             Weight          =   700
  86.             Underline       =   0   'False
  87.             Italic          =   0   'False
  88.             Strikethrough   =   0   'False
  89.          EndProperty
  90.          ForeColor       =   &H00000000&
  91.          Height          =   240
  92.          Index           =   4
  93.          Left            =   600
  94.          TabIndex        =   2
  95.          Top             =   210
  96.          Width           =   1275
  97.       End
  98.    End
  99.    Begin MSComctlLib.Toolbar GsToolbar 
  100.       Height          =   525
  101.       Left            =   7695
  102.       TabIndex        =   0
  103.       Top             =   15
  104.       Width           =   1665
  105.       _ExtentX        =   2937
  106.       _ExtentY        =   926
  107.       ButtonWidth     =   1455
  108.       ButtonHeight    =   926
  109.       AllowCustomize  =   0   'False
  110.       Appearance      =   1
  111.       Style           =   1
  112.       ImageList       =   "ImageList1"
  113.       _Version        =   393216
  114.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  115.          NumButtons      =   2
  116.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  117.             Caption         =   "保存格式"
  118.             Key             =   "bcgs"
  119.             ImageKey        =   "bcgs"
  120.          EndProperty
  121.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  122.             Caption         =   "默认列宽"
  123.             Key             =   "hfmrgs"
  124.             ImageKey        =   "mrlk"
  125.          EndProperty
  126.       EndProperty
  127.    End
  128.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  129.       Height          =   5490
  130.       Left            =   -30
  131.       TabIndex        =   3
  132.       Top             =   1605
  133.       Width           =   9405
  134.       _cx             =   5080
  135.       _cy             =   5080
  136.       Appearance      =   1
  137.       BorderStyle     =   1
  138.       Enabled         =   -1  'True
  139.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  140.          Name            =   "宋体"
  141.          Size            =   9
  142.          Charset         =   134
  143.          Weight          =   400
  144.          Underline       =   0   'False
  145.          Italic          =   0   'False
  146.          Strikethrough   =   0   'False
  147.       EndProperty
  148.       MousePointer    =   0
  149.       BackColor       =   16777215
  150.       ForeColor       =   -2147483640
  151.       BackColorFixed  =   12632256
  152.       ForeColorFixed  =   -2147483630
  153.       BackColorSel    =   -2147483635
  154.       ForeColorSel    =   -2147483634
  155.       BackColorBkg    =   -2147483636
  156.       BackColorAlternate=   16777215
  157.       GridColor       =   -2147483633
  158.       GridColorFixed  =   -2147483632
  159.       TreeColor       =   -2147483632
  160.       FloodColor      =   192
  161.       SheetBorder     =   -2147483642
  162.       FocusRect       =   1
  163.       HighLight       =   1
  164.       AllowSelection  =   -1  'True
  165.       AllowBigSelection=   -1  'True
  166.       AllowUserResizing=   0
  167.       SelectionMode   =   0
  168.       GridLines       =   1
  169.       GridLinesFixed  =   2
  170.       GridLineWidth   =   1
  171.       Rows            =   50
  172.       Cols            =   10
  173.       FixedRows       =   1
  174.       FixedCols       =   0
  175.       RowHeightMin    =   0
  176.       RowHeightMax    =   0
  177.       ColWidthMin     =   0
  178.       ColWidthMax     =   0
  179.       ExtendLastCol   =   0   'False
  180.       FormatString    =   ""
  181.       ScrollTrack     =   0   'False
  182.       ScrollBars      =   3
  183.       ScrollTips      =   0   'False
  184.       MergeCells      =   0
  185.       MergeCompare    =   0
  186.       AutoResize      =   -1  'True
  187.       AutoSizeMode    =   0
  188.       AutoSearch      =   0
  189.       AutoSearchDelay =   2
  190.       MultiTotals     =   -1  'True
  191.       SubtotalPosition=   1
  192.       OutlineBar      =   0
  193.       OutlineCol      =   0
  194.       Ellipsis        =   0
  195.       ExplorerBar     =   0
  196.       PicturesOver    =   0   'False
  197.       FillStyle       =   0
  198.       RightToLeft     =   0   'False
  199.       PictureType     =   0
  200.       TabBehavior     =   0
  201.       OwnerDraw       =   0
  202.       Editable        =   0
  203.       ShowComboButton =   1
  204.       WordWrap        =   0   'False
  205.       TextStyle       =   0
  206.       TextStyleFixed  =   0
  207.       OleDragMode     =   0
  208.       OleDropMode     =   0
  209.       DataMode        =   0
  210.       VirtualData     =   -1  'True
  211.       DataMember      =   ""
  212.       ComboSearch     =   3
  213.       AutoSizeMouse   =   -1  'True
  214.       FrozenRows      =   0
  215.       FrozenCols      =   0
  216.       AllowUserFreezing=   0
  217.       BackColorFrozen =   0
  218.       ForeColorFrozen =   0
  219.       WallPaperAlignment=   9
  220.       AccessibleName  =   ""
  221.       AccessibleDescription=   ""
  222.       AccessibleValue =   ""
  223.       AccessibleRole  =   24
  224.    End
  225.    Begin MSComctlLib.Toolbar SzToolbar 
  226.       Align           =   1  'Align Top
  227.       Height          =   555
  228.       Left            =   0
  229.       TabIndex        =   4
  230.       Top             =   0
  231.       Width           =   9375
  232.       _ExtentX        =   16536
  233.       _ExtentY        =   979
  234.       ButtonWidth     =   820
  235.       ButtonHeight    =   926
  236.       AllowCustomize  =   0   'False
  237.       Appearance      =   1
  238.       Style           =   1
  239.       ImageList       =   "ImageList1"
  240.       _Version        =   393216
  241.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  242.          NumButtons      =   10
  243.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  244.             Caption         =   "设置"
  245.             Key             =   "ymsz"
  246.             ImageKey        =   "sz"
  247.          EndProperty
  248.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  249.             Caption         =   "打印"
  250.             Key             =   "dy"
  251.             ImageKey        =   "dy"
  252.          EndProperty
  253.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  254.             Caption         =   "预览"
  255.             Key             =   "yl"
  256.             ImageKey        =   "yl"
  257.          EndProperty
  258.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  259.             Style           =   3
  260.          EndProperty
  261.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  262.             Caption         =   "查询"
  263.             Key             =   "cx"
  264.             ImageKey        =   "cx"
  265.          EndProperty
  266.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  267.             Object.Visible         =   0   'False
  268.             Style           =   3
  269.          EndProperty
  270.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  271.             Object.Visible         =   0   'False
  272.             Caption         =   "累计"
  273.             Key             =   "lj"
  274.             ImageKey        =   "lj"
  275.             Style           =   1
  276.          EndProperty
  277.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  278.             Style           =   3
  279.          EndProperty
  280.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  281.             Caption         =   "帮助"
  282.             Key             =   "bz"
  283.             ImageKey        =   "bz"
  284.          EndProperty
  285.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  286.             Caption         =   "退出"
  287.             Key             =   "fh"
  288.             ImageKey        =   "tc"
  289.          EndProperty
  290.       EndProperty
  291.       BorderStyle     =   1
  292.       Begin MSComctlLib.ImageList ImageList1 
  293.          Left            =   6450
  294.          Top             =   30
  295.          _ExtentX        =   1005
  296.          _ExtentY        =   1005
  297.          BackColor       =   -2147483643
  298.          ImageWidth      =   16
  299.          ImageHeight     =   16
  300.          MaskColor       =   12632256
  301.          _Version        =   393216
  302.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  303.             NumListImages   =   35
  304.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  305.                Picture         =   "报表分析_损益表分析.frx":35106
  306.                Key             =   "sz"
  307.             EndProperty
  308.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.                Picture         =   "报表分析_损益表分析.frx":354A0
  310.                Key             =   "dy"
  311.             EndProperty
  312.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.                Picture         =   "报表分析_损益表分析.frx":3583A
  314.                Key             =   "yl"
  315.             EndProperty
  316.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.                Picture         =   "报表分析_损益表分析.frx":35BD4
  318.                Key             =   "xg"
  319.             EndProperty
  320.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.                Picture         =   "报表分析_损益表分析.frx":35F6E
  322.                Key             =   "zh"
  323.             EndProperty
  324.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  325.                Picture         =   "报表分析_损益表分析.frx":36308
  326.                Key             =   "sh"
  327.             EndProperty
  328.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  329.                Picture         =   "报表分析_损益表分析.frx":366A2
  330.                Key             =   "bc"
  331.             EndProperty
  332.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  333.                Picture         =   "报表分析_损益表分析.frx":36A3C
  334.                Key             =   "fq"
  335.             EndProperty
  336.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  337.                Picture         =   "报表分析_损益表分析.frx":36DD6
  338.                Key             =   "bz"
  339.             EndProperty
  340.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  341.                Picture         =   "报表分析_损益表分析.frx":37170
  342.                Key             =   "tc"
  343.             EndProperty
  344.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  345.                Picture         =   "报表分析_损益表分析.frx":3750A
  346.                Key             =   "bcgs"
  347.             EndProperty
  348.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  349.                Picture         =   "报表分析_损益表分析.frx":378A4
  350.                Key             =   "mrlk"
  351.             EndProperty
  352.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  353.                Picture         =   "报表分析_损益表分析.frx":37C3E
  354.                Key             =   "xsxm"
  355.             EndProperty
  356.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  357.                Picture         =   "报表分析_损益表分析.frx":37FD8
  358.                Key             =   "first"
  359.             EndProperty
  360.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  361.                Picture         =   "报表分析_损益表分析.frx":38372
  362.                Key             =   "prev"
  363.             EndProperty
  364.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  365.                Picture         =   "报表分析_损益表分析.frx":3870C
  366.                Key             =   "next"
  367.             EndProperty
  368.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  369.                Picture         =   "报表分析_损益表分析.frx":38AA6
  370.                Key             =   "last"
  371.             EndProperty
  372.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  373.                Picture         =   "报表分析_损益表分析.frx":38E40
  374.                Key             =   "xx"
  375.             EndProperty
  376.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  377.                Picture         =   "报表分析_损益表分析.frx":391DA
  378.                Key             =   "define"
  379.             EndProperty
  380.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  381.                Picture         =   "报表分析_损益表分析.frx":39574
  382.                Key             =   "exec"
  383.             EndProperty
  384.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  385.                Picture         =   "报表分析_损益表分析.frx":3990E
  386.                Key             =   "xz"
  387.             EndProperty
  388.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  389.                Picture         =   "报表分析_损益表分析.frx":39CA8
  390.                Key             =   "sc"
  391.             EndProperty
  392.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  393.                Picture         =   "报表分析_损益表分析.frx":3A042
  394.                Key             =   "sx"
  395.             EndProperty
  396.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  397.                Picture         =   "报表分析_损益表分析.frx":3A3DC
  398.                Key             =   "cx"
  399.             EndProperty
  400.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  401.                Picture         =   "报表分析_损益表分析.frx":3A776
  402.                Key             =   "zd"
  403.             EndProperty
  404.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  405.                Picture         =   "报表分析_损益表分析.frx":3AB10
  406.                Key             =   "dz"
  407.             EndProperty
  408.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  409.                Picture         =   "报表分析_损益表分析.frx":3AEAA
  410.                Key             =   "ph"
  411.             EndProperty
  412.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  413.                Picture         =   "报表分析_损益表分析.frx":3B244
  414.                Key             =   "fz"
  415.             EndProperty
  416.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  417.                Picture         =   "报表分析_损益表分析.frx":3B5DE
  418.                Key             =   "dw"
  419.             EndProperty
  420.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  421.                Picture         =   "报表分析_损益表分析.frx":3B978
  422.                Key             =   "hf"
  423.             EndProperty
  424.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  425.                Picture         =   "报表分析_损益表分析.frx":3BD12
  426.                Key             =   "pz"
  427.             EndProperty
  428.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  429.                Picture         =   "报表分析_损益表分析.frx":3C0AC
  430.                Key             =   "check"
  431.             EndProperty
  432.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  433.                Picture         =   "报表分析_损益表分析.frx":3C446
  434.                Key             =   "zz"
  435.             EndProperty
  436.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  437.                Picture         =   "报表分析_损益表分析.frx":3C7E0
  438.                Key             =   "mx"
  439.             EndProperty
  440.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  441.                Picture         =   "报表分析_损益表分析.frx":3CB7A
  442.                Key             =   "lj"
  443.             EndProperty
  444.          EndProperty
  445.       End
  446.    End
  447. End
  448. Attribute VB_Name = "Bbfx_FrmIncFx"
  449. Attribute VB_GlobalNameSpace = False
  450. Attribute VB_Creatable = False
  451. Attribute VB_PredeclaredId = True
  452. Attribute VB_Exposed = False
  453. '*************************************************************
  454. '*    模 块 名 称 :损益表分析
  455. '*    功 能 描 述 :对损益表的各种分析
  456. '*    程序员姓名  : 魏永生
  457. '*    最后修改人  :
  458. '*    最后修改时间:2002/1/15
  459. '*    备        注:
  460. '*    损益表分析/绝对数分析
  461. '*    损益表分析/定基分析
  462. '*    损益表分析/环比分析
  463. '*    损益表分析/对比分析
  464. '*    损益表分析/结构分析
  465. '*************************************************************
  466. Option Explicit
  467. Private Const COL_WIDTH = 1500
  468. Private Const DATE_FIX = "/"
  469. Public strBegin As String '季日期
  470. Public strEnd As String '季日期
  471. Public bIFComp As Boolean               '是否有比较期
  472. Public iThisYear As Integer             '本年
  473. Public iThisMonthBegin As Integer       '本年月起始
  474. Public iThisMonthEnd As Integer         '本年终止月
  475. Public iCompYear As Integer             '比较年
  476. Public iCompMonthBegin As Integer       '比较年月开始
  477. Public iCompMonthEnd  As Integer        '比较年终止月
  478. Public intType As Integer               '比较类型,0按月、1按季、2按年
  479. Public strItem As String                '资产负债表的分枝类别,与树型菜单一致
  480. Public strTemItem As String             '同上
  481. Public bSeach As Boolean                '是否执行查询
  482. Private Rs As New ADODB.Recordset
  483. Private myclsInc As New clsInc          '损益表类
  484. Private GridStarCol As Integer          ' = 2 '网格起始数据列
  485. Private itype As Integer
  486. Dim iWriteCols As Integer               '循环写入列数(用于写数据到网格)
  487. Dim iWriteRows As Integer                '循环写入行数
  488. Dim ReportTitle As String                '报表主标题
  489. '以下为固定使用变量
  490. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  491. Dim GridCode As String                   '显示网格网格代码
  492. Dim GridInf() As Variant                 '整个网格设置信息
  493. Dim Tsxx As String                       '系统提示信息
  494. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  495. Dim Sjhgd As Double                      '网格数据行高度
  496. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  497. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  498. Dim GridStr()  As String                 '网格列信息(字符型)
  499. Dim GridInt() As Integer                 '网格列信息(整型)
  500. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  501. Dim Bln_Stop As Boolean                  '停止输出查询结果
  502. Private Sub Form_Load()
  503.     If DEBUG_FLAG = False Then On Error Resume Next
  504.     strTemItem = strItem
  505.     
  506.     XtReportCode = "cwfx_IncFx"
  507.     Load Dyymctbl
  508.     myclsInc.Init Cw_DataEnvi.DataConnect
  509. End Sub
  510. Public Sub FormInit()
  511.     If DEBUG_FLAG = False Then On Error Resume Next
  512.     '窗体被始化
  513.     ReportTitle = Me.TsLabel(4).Caption '打印标题
  514.     GridCode = strItem
  515.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  516.     Qslz = GridInf(1)
  517.     Sjhgd = GridInf(2)
  518.     Sfxshjwg = GridInf(7)
  519.     Szzls = CxbbGrid.Cols - 1
  520.     CxbbGrid.Redraw = False
  521.     Select Case strItem
  522.     Case "cwfx_IncJds", "cwfx_IncDj", "cwfx_IncHb" '绝对数、定基、环比
  523.         Call GetIncItem
  524.         iWriteCols = 2
  525.         Call AddGridCol
  526.         Call FillGrid
  527.     Case "cwfx_IncDb" '对比
  528.         Call GetIncItem
  529.         Call dbFillGrid
  530.     Case "cwfx_IncJg" '结构
  531.         Call GetIncItem
  532.         Call jgFillGrid
  533.     End Select
  534.     CxbbGrid.Redraw = True
  535. End Sub
  536. Private Sub GetIncItem()
  537.     If DEBUG_FLAG = False Then On Error Resume Next
  538.     '填充资产类项目
  539.     Dim iRow As Integer
  540.     Set Rs = Cw_DataEnvi.DataConnect.Execute("select * from cwfx_IncomeCostInitial")
  541.     
  542.     iWriteRows = Rs.RecordCount - 1 '循环写入行数
  543.     
  544.     With CxbbGrid
  545.         iRow = .FixedRows
  546.         Do Until Rs.EOF
  547.             .AddItem ""
  548.             .TextMatrix(iRow, Sydz("001", GridStr(), Szzls)) = RTrim(Rs!comment)
  549.             .TextMatrix(iRow, 0) = Trim(Rs!Item)
  550.             .RowHeight(iRow) = Sjhgd
  551.             Rs.MoveNext
  552.             iRow = iRow + 1
  553.         Loop
  554.     End With
  555. End Sub
  556. Private Sub AddGridCol()
  557.     If DEBUG_FLAG = False Then On Error Resume Next
  558.     Dim Item As Integer
  559.     Dim I As Integer
  560.     
  561.     iWriteCols = 0 '循环写入写数置0
  562.     
  563.     Select Case intType
  564.     Case 0 '月
  565.         If iThisMonthBegin > iThisMonthEnd Then
  566.             Item = iThisMonthBegin
  567.             iThisMonthBegin = iThisMonthEnd
  568.             iThisMonthEnd = Item
  569.         End If
  570.         
  571.         For I = iThisMonthBegin To iThisMonthEnd
  572.             iWriteCols = iWriteCols + 1
  573.             With CxbbGrid
  574.                 .Cols = .Cols + 1
  575.                 .FixedAlignment(.Cols - 1) = flexAlignCenterCenter
  576.                 .ColAlignment(.Cols - 1) = 6
  577.                 .ColWidth(.Cols - 1) = COL_WIDTH
  578.                 .ColFormat(.Cols - 1) = "#,##0.00"
  579.                 .TextMatrix(.FixedRows - 1, .Cols - 1) = CStr(Xtyear) & DATE_FIX & Format(I, "00") & ""
  580.                 
  581.             End With
  582.         Next
  583.     Case 1 '季
  584.         
  585.         If iThisMonthBegin > iThisMonthEnd Then
  586.             Item = iThisMonthBegin
  587.             iThisMonthBegin = iThisMonthEnd
  588.             iThisMonthEnd = Item
  589.         End If
  590.         
  591.         For I = iThisMonthBegin To iThisMonthEnd Step 3
  592.             
  593.             iWriteCols = iWriteCols + 1
  594.             
  595.             With CxbbGrid
  596.                 .Cols = .Cols + 1
  597.                 .FixedAlignment(.Cols - 1) = flexAlignCenterCenter
  598.                 .ColAlignment(.Cols - 1) = 6
  599.                 .ColWidth(.Cols - 1) = COL_WIDTH
  600.                 .ColFormat(.Cols - 1) = "#,##0.00"
  601.                 .TextMatrix(.FixedRows - 1, .Cols - 1) = CStr(Xtyear) & DATE_FIX & Format(CStr(I - 2), "00") & "-" & CStr(Xtyear) & DATE_FIX & Format(CStr(I), "00") & ""
  602.             End With
  603.         Next
  604.     Case 2 '年
  605.         If iThisYear > iCompYear Then
  606.             Item = iThisYear
  607.             iThisYear = iCompYear
  608.             iCompYear = Item
  609.         End If
  610.         
  611.         For I = iCompYear To iThisYear
  612.             
  613.             iWriteCols = iWriteCols + 1
  614.             
  615.             With CxbbGrid
  616.                 .Cols = .Cols + 1
  617.                 .FixedAlignment(.Cols - 1) = flexAlignCenterCenter
  618.                 .ColAlignment(.Cols - 1) = 6
  619.                 .ColWidth(.Cols - 1) = COL_WIDTH
  620.                 .ColFormat(.Cols - 1) = "#,##0.00"
  621.                 .TextMatrix(.FixedRows - 1, .Cols - 1) = CStr(I) & "年"
  622.             End With
  623.         Next
  624.     End Select
  625.     
  626. End Sub
  627. '=================写数据到表格===========================================
  628. Private Sub dbFillGrid()
  629.     Dim iRow As Integer '网格列
  630.         
  631.     Dim dbl_Fxq As Double                  '分析期数据
  632.     Dim dbl_Dbq As Double                   '对比期数据
  633.     Dim dbl_Cha As Double                   '对比期与分析期之差
  634.     Dim strItem As String
  635.     Dim clsIncClass As New clsInc
  636.     
  637.     Call date_Change
  638.     
  639.     clsIncClass.Init Cw_DataEnvi.DataConnect  '初始化
  640.     
  641.     With CxbbGrid
  642.         For iRow = .FixedRows To .Rows - 1
  643.             strItem = .TextMatrix(iRow, 0)
  644.             If intType = 1 Then                 '按季
  645.                 dbl_Fxq = clsIncClass.GetPeriodValue(strItem, Val(Mid(strBegin, 6, 1)), Val(Right(strBegin, 1)), iThisYear)
  646.                 dbl_Dbq = clsIncClass.GetPeriodValue(strItem, Val(Mid(strEnd, 6, 1)), Val(Right(strEnd, 1)), iThisYear)
  647.             ElseIf intType = 0 Then             '月
  648.                 dbl_Fxq = clsIncClass.GetPeriodValue(strItem, iThisMonthBegin, iThisMonthBegin, iThisYear)
  649.                 dbl_Dbq = clsIncClass.GetPeriodValue(strItem, iCompMonthEnd, iCompMonthEnd, iThisYear)
  650.             ElseIf intType = 2 Then             '年
  651.                 dbl_Fxq = clsIncClass.GetPeriodValue(strItem, 1, 12, iThisYear)
  652.                 dbl_Dbq = clsIncClass.GetPeriodValue(strItem, 1, 12, iCompYear)
  653.             End If
  654.             
  655.             dbl_Cha = dbl_Fxq - dbl_Dbq
  656.             
  657.             .TextMatrix(iRow, Sydz("002", GridStr(), Szzls)) = IIf(dbl_Fxq = 0, "", dbl_Fxq)
  658.             .TextMatrix(iRow, Sydz("003", GridStr(), Szzls)) = IIf(dbl_Dbq = 0, "", dbl_Dbq)
  659.             .TextMatrix(iRow, Sydz("004", GridStr(), Szzls)) = IIf(dbl_Cha = 0, "", dbl_Cha)
  660.             If dbl_Dbq <> 0 Then
  661.                 .TextMatrix(iRow, Sydz("005", GridStr(), Szzls)) = (dbl_Cha / dbl_Dbq) * 100
  662.             Else
  663.                 .TextMatrix(iRow, Sydz("005", GridStr(), Szzls)) = ""
  664.             End If
  665.             
  666.         Next
  667.     End With
  668.     Set clsIncClass = Nothing
  669. End Sub
  670. Private Sub jgFillGrid()
  671.     Dim iRow As Integer                     '网格列
  672.     
  673.     Dim dbl_Fxq As Double                   '分析期数据
  674.     Dim dbl_Dbq As Double                   '对比期数据
  675.     
  676.     Dim dbl_FxqTotal As Double              '分析期总额
  677.     Dim dbl_dbqTotal As Double              '对比期总额
  678.     
  679.     Dim dbl_LeiJiyear As Double             '全年累计
  680.     Dim dbl_LeiJiyearTotal As Double        '全年累计总额
  681.     
  682.     Dim dbl_Char As Double                  '结构差额
  683.     Dim dbl_Cha As Double
  684.     Dim clsIncClass As New clsInc
  685.     
  686.     Call date_Change
  687.     
  688.     clsIncClass.Init Cw_DataEnvi.DataConnect  '初始化
  689.     
  690.     '----------算出年累计总金额、分析期总金额、对比期总金额-----------------------
  691.     If intType = 1 Then '按季
  692.         dbl_LeiJiyearTotal = 0 '年累计总金额
  693.         dbl_FxqTotal = clsIncClass.GetPeriodValue(strItem, Mid(strBegin, 6, 2), Right(strBegin, 2), iThisYear) '分析期总金额
  694.         dbl_dbqTotal = clsIncClass.GetPeriodValue(strItem, Mid(strEnd, 6, 2), Right(strEnd, 2), iThisYear) '对比期总金额
  695.     ElseIf intType = 0 Then '月
  696.         dbl_LeiJiyearTotal = clsIncClass.GetPeriodValue("产品销售收入", 1, 12, iThisYear) '年累计总金额
  697.         dbl_FxqTotal = clsIncClass.GetPeriodValue("产品销售收入", iThisMonthBegin, iThisMonthBegin, iThisYear) '分析期总金额
  698.         dbl_dbqTotal = clsIncClass.GetPeriodValue("产品销售收入", iCompMonthBegin, iCompMonthBegin, iThisYear) '对比期总金额
  699.     ElseIf intType = 2 Then '年
  700.         dbl_LeiJiyearTotal = clsIncClass.GetPeriodValue("产品销售收入", 1, 12, iThisYear) '年累计总金额
  701.         dbl_FxqTotal = clsIncClass.GetPeriodValue("产品销售收入", 1, 12, iThisYear) '分析期总金额
  702.         dbl_dbqTotal = clsIncClass.GetPeriodValue("产品销售收入", 1, 12, iCompYear) '对比期总金额
  703.     End If
  704.     '-----------------------------------------------
  705.     With CxbbGrid
  706.         For iRow = .FixedRows To .Rows - 1
  707.             
  708.             strItem = .TextMatrix(iRow, 0)  '取得每行项目名称
  709.             
  710.             '---------------算出每行的分析期、对比期、年累计数据---------------------
  711.             If intType = 1 Then               '按季
  712.                 dbl_Fxq = clsIncClass.GetPeriodValue(strItem, Val(Mid(strBegin, 6, 1)), Val(Right(strBegin, 1)), iThisYear)
  713.                 dbl_Dbq = clsIncClass.GetPeriodValue(strItem, Val(Mid(strEnd, 6, 1)), Val(Right(strEnd, 1)), iThisYear)
  714.                 dbl_LeiJiyear = clsIncClass.GetPeriodValue(strItem, 1, 12, iThisYear)
  715.             ElseIf intType = 0 Then             '月
  716.                 dbl_Fxq = clsIncClass.GetPeriodValue(strItem, iThisMonthBegin, iThisMonthBegin, iThisYear)
  717.                 dbl_Dbq = clsIncClass.GetPeriodValue(strItem, iCompMonthEnd, iCompMonthEnd, iThisYear)
  718.                 dbl_LeiJiyear = clsIncClass.GetPeriodValue(strItem, 1, 12, iThisYear)
  719.             ElseIf intType = 2 Then             '年
  720.                 dbl_Fxq = clsIncClass.GetPeriodValue(strItem, 1, 12, iThisYear)
  721.                 dbl_Dbq = clsIncClass.GetPeriodValue(strItem, 1, 12, iCompYear)
  722.                 dbl_LeiJiyear = clsIncClass.GetPeriodValue(strItem, 1, 12, iThisYear)
  723.             End If
  724.             '-------------------------------------------------------------------------
  725.             
  726.             .TextMatrix(iRow, Sydz("002", GridStr(), Szzls)) = IIf(dbl_Fxq = 0, "", dbl_Fxq) '分析期金额
  727.             .TextMatrix(iRow, Sydz("004", GridStr(), Szzls)) = IIf(dbl_Dbq = 0, "", dbl_Dbq) '比较期金额
  728.             .TextMatrix(iRow, Sydz("007", GridStr(), Szzls)) = IIf(dbl_LeiJiyear = 0, "", dbl_LeiJiyear) '全年累计金额
  729.             '------------分析期结构----------------
  730.             If dbl_FxqTotal <> 0 Then
  731.                 .TextMatrix(iRow, Sydz("003", GridStr(), Szzls)) = (dbl_Fxq / dbl_FxqTotal) * 100
  732.             Else
  733.                 .TextMatrix(iRow, Sydz("003", GridStr(), Szzls)) = ""
  734.             End If
  735.             '------------对比期结构-----------------
  736.             If dbl_dbqTotal <> 0 Then
  737.                 .TextMatrix(iRow, Sydz("005", GridStr(), Szzls)) = (dbl_Dbq / dbl_dbqTotal) * 100
  738.             Else
  739.                 .TextMatrix(iRow, Sydz("005", GridStr(), Szzls)) = ""
  740.             End If
  741.             '-------------结构增减--------------------
  742.             dbl_Cha = -Val(.TextMatrix(iRow, Sydz("005", GridStr(), Szzls))) + Val(.TextMatrix(iRow, Sydz("003", GridStr(), Szzls)))
  743.             .TextMatrix(iRow, Sydz("006", GridStr(), Szzls)) = IIf(dbl_Cha = 0, "", dbl_Cha)
  744.             '-------------全年累计结构---------------------
  745.             If dbl_LeiJiyearTotal <> 0 Then
  746.                 .TextMatrix(iRow, Sydz("008", GridStr(), Szzls)) = (dbl_LeiJiyear / dbl_LeiJiyearTotal) * 100
  747.             Else
  748.                 .TextMatrix(iRow, Sydz("008", GridStr(), Szzls)) = ""
  749.             End If
  750.             '-----------------------------------
  751.         Next
  752.     End With
  753.     
  754.     Set clsIncClass = Nothing
  755. End Sub
  756. Private Sub date_Change()
  757.     lab_Fxq.Caption = "分析期:"
  758.     lab_Bjq.Caption = "比较期:"
  759.     If intType = 1 Then '按季查询
  760.         lab_fx.Caption = Space(4) & strBegin
  761.         lab_bj.Caption = Space(4) & strEnd
  762.         
  763.     Else
  764.         lab_fx.Caption = Space(4) & CStr(iThisYear) & IIf(iThisMonthBegin = 0, "", DATE_FIX & CStr(iThisMonthBegin))
  765.         If bIFComp = True Then
  766.             lab_bj.Caption = Space(4) & CStr(iThisYear) & IIf(iCompMonthBegin = 0, "", DATE_FIX & CStr(iCompMonthBegin))
  767.         Else
  768.             lab_bj.Caption = ""
  769.         End If
  770.         
  771.     End If
  772.     
  773. End Sub
  774. Private Sub FillGrid()
  775.     If DEBUG_FLAG = False Then On Error Resume Next
  776.     Dim iRow As Integer
  777.     Dim iCol As Integer
  778.     Dim dbl_Return As Double
  779.     Dim dbl_BaseValue As Double         '本期数据
  780.     Dim dbl_OldValue As Double          '上期数据
  781.     GridStarCol = 2
  782.     For iCol = GridStarCol To GridStarCol + iWriteCols - 1
  783.         iRow = CxbbGrid.FixedRows
  784.         
  785.         lab_Fxq.Caption = "从:"
  786.         lab_Bjq.Caption = "到:"
  787.         If intType = 1 Then             '按季查询
  788.             lab_fx.Caption = strBegin
  789.             lab_bj.Caption = strEnd
  790.         Else
  791.             lab_fx.Caption = CStr(iThisYear) & IIf(iThisMonthBegin = 0, "", DATE_FIX & CStr(iThisMonthBegin))
  792.             lab_bj.Caption = CStr(iThisYear) & IIf(iThisMonthEnd = 0, "", DATE_FIX & CStr(iThisMonthEnd))
  793.         End If
  794.         With Rs
  795.             If Not (.EOF And .BOF) Then
  796.                 .MoveFirst
  797.                 Do Until .EOF
  798.                     DoEvents
  799.                     If IsNull(!comment) = False Then
  800.                         If iRow > CxbbGrid.Rows Then CxbbGrid.AddItem ""
  801.                         Select Case strItem
  802.                         Case "cwfx_IncJds"      '绝对数分析
  803.                             Label_Bfb.Visible = False
  804.                             
  805.                             dbl_Return = TimeClass(Trim(!Item), iCol)
  806.                             CxbbGrid.TextMatrix(iRow, iCol) = IIf(dbl_Return = 0, "", dbl_Return)
  807.                         Case "cwfx_IncDj"        '定基分析
  808.                             Label_Bfb.Visible = True
  809.                             dbl_OldValue = TimeClass(Trim(!Item), iCol)
  810.                             
  811.                             If iCol = GridStarCol Then  '如果为起始列,则基数据为本期数据
  812.                                 dbl_BaseValue = dbl_OldValue
  813.                                 CxbbGrid.RowData(iRow) = dbl_OldValue '并保存基数据
  814.                             Else                         '取保存的基数据为比较数据
  815.                                 dbl_BaseValue = CxbbGrid.RowData(iRow)
  816.                             End If
  817.                             If dbl_BaseValue <> 0 Then
  818.                                 dbl_Return = Format((dbl_OldValue / dbl_BaseValue * 100), "#,##0.##")
  819.                                 CxbbGrid.TextMatrix(iRow, iCol) = IIf(dbl_Return = 0, "", CStr(dbl_Return) & "")
  820.                             Else
  821.                                 CxbbGrid.TextMatrix(iRow, iCol) = ""
  822.                             End If
  823.                             dbl_BaseValue = dbl_OldValue
  824.                         Case "cwfx_IncHb"       '环比分析
  825.                             Label_Bfb.Visible = True
  826.                             dbl_OldValue = TimeClass(Trim(!Item), iCol)
  827.                             If iCol = GridStarCol Then '如果为起始列,则基数据为本期数据
  828.                                 dbl_BaseValue = dbl_OldValue
  829.                                 CxbbGrid.RowData(iRow) = dbl_OldValue '并保存基数据
  830.                             Else
  831.                                 dbl_BaseValue = CxbbGrid.RowData(iRow)
  832.                             End If
  833.                             If dbl_BaseValue <> 0 And dbl_OldValue <> 0 Then
  834.                                 dbl_Return = Format((dbl_OldValue / dbl_BaseValue * 100), "#,##0.##")
  835.                                 CxbbGrid.TextMatrix(iRow, iCol) = IIf(dbl_Return = 0, "", CStr(dbl_Return) & "")
  836.                                 CxbbGrid.RowData(iRow) = dbl_Return
  837.                             ElseIf dbl_BaseValue = 0 And dbl_OldValue = 0 Then
  838.                                 CxbbGrid.TextMatrix(iRow, iCol) = ""
  839.                             ElseIf dbl_BaseValue = 0 And dbl_OldValue <> 0 Then
  840.                                 CxbbGrid.TextMatrix(iRow, iCol) = ""
  841.                                 CxbbGrid.RowData(iRow) = dbl_OldValue
  842.                             End If
  843.                             
  844.                         End Select
  845.                     End If
  846.                     iRow = iRow + 1
  847.                     .MoveNext
  848.                 Loop
  849.             End If
  850.         End With
  851.     Next iCol
  852.     
  853. End Sub
  854. Private Function TimeClass(ByVal ItemClass As String, ByVal iCol As Integer) As Double
  855.     If DEBUG_FLAG = False Then On Error Resume Next
  856.     Dim iTemMonthBegin As Integer
  857.     Dim iTemMonthEnd As Integer
  858.     Dim iTemYear As Integer
  859.     Select Case intType
  860.     Case 0 '月
  861.         iTemYear = Xtyear
  862.         iTemMonthBegin = iThisMonthBegin
  863.         iTemMonthEnd = iThisMonthEnd
  864.         With CxbbGrid
  865.             iTemMonthBegin = Right(.TextMatrix(.FixedRows - 1, iCol), 2)
  866.             iTemMonthEnd = iTemMonthBegin
  867.         End With
  868.         TimeClass = myclsInc.GetPeriodValue(ItemClass, iTemMonthBegin, iTemMonthEnd, iTemYear)
  869.     Case 1 '季
  870.         iTemYear = Xtyear
  871.         iTemMonthBegin = Val(Mid(CxbbGrid.TextMatrix(CxbbGrid.FixedRows - 1, iCol), 6, 2))
  872.         iTemMonthEnd = Val(Mid(CxbbGrid.TextMatrix(CxbbGrid.FixedRows - 1, iCol), 14, 2))
  873.         TimeClass = myclsInc.GetPeriodValue(ItemClass, iTemMonthBegin, iTemMonthEnd, iTemYear)
  874.     Case 2 '年
  875.         iTemYear = Val(CxbbGrid.TextMatrix(CxbbGrid.FixedRows - 1, iCol))
  876.         TimeClass = myclsInc.GetPeriodValue(ItemClass, 1, 12, iTemYear)
  877.     End Select
  878. End Function
  879. Private Function TimeClass2(ByVal ItemClass As String, ByVal cCol As String) As Double
  880.     If DEBUG_FLAG = False Then On Error Resume Next
  881.     Dim iTemMonthBegin As Integer
  882.     Dim iTemMonthEnd As Integer
  883.     Dim iTemYear As Integer
  884.     itype = Me.intType
  885.     Select Case itype
  886.     Case 0                                      '月
  887.         If cCol = "001" Or cCol = "002" Then            '分析期
  888.             iTemYear = iThisYear
  889.             iTemMonthBegin = iThisMonthBegin
  890.             iTemMonthEnd = iThisMonthEnd
  891.         ElseIf cCol = "003" Or cCol = "004" Then        '比较期
  892.             iTemYear = iCompYear
  893.             iTemMonthBegin = iCompMonthBegin
  894.             iTemMonthEnd = iCompMonthEnd
  895.         End If
  896.         
  897.         TimeClass2 = myclsInc.GetPeriodValue(ItemClass, iTemMonthBegin, iTemMonthEnd, iTemYear)
  898.         
  899.     Case 1                                      '季
  900.         If cCol = "001" Or cCol = "002" Then            '分析期
  901.             iTemYear = iThisYear
  902.             iTemMonthBegin = iThisMonthBegin
  903.             iTemMonthEnd = iThisMonthEnd
  904.         ElseIf cCol = "003" Or cCol = "004" Then        '比较期
  905.             iTemYear = iCompYear
  906.             iTemMonthBegin = iCompMonthBegin
  907.             iTemMonthEnd = iCompMonthEnd
  908.         End If
  909.         
  910.         TimeClass2 = myclsInc.GetPeriodValue(ItemClass, iTemMonthBegin, iTemMonthEnd, iTemYear)
  911.     Case 2                                      '年
  912.         If cCol = "001" Or cCol = "002" Then            '分析期
  913.             iTemYear = iThisYear
  914.         ElseIf cCol = "003" Or cCol = "004" Then        '比较期            iTemYear = iCompYear
  915.         End If
  916.         
  917.         TimeClass2 = myclsInc.GetPeriodValue(ItemClass, 1, 12, iTemYear)
  918.     End Select
  919. End Function
  920. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  921.     On Error Resume Next
  922.     With CxbbGrid
  923.         .Width = Me.Width - 160
  924.         .Height = Me.Height - .Top - 400
  925.     End With
  926.     With Pic_Title
  927.         .Width = Me.Width - 160
  928.     End With
  929.     
  930.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  931. End Sub
  932. Private Sub Form_Unload(Cancel As Integer)
  933.     If DEBUG_FLAG = False Then On Error Resume Next
  934.     '卸载打印页面设置窗体
  935.     Unload Dyymctbl
  936. End Sub
  937. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  938.     If DEBUG_FLAG = False Then On Error Resume Next
  939.     Select Case Button.Key
  940.     Case "ymsz"                                          '页面设置
  941.         Dyymctbl.Show 1
  942.     Case "yl"                                            '预 览
  943.         Call bbyl(True)
  944.     Case "dy"                                            '打 印
  945.         Call bbyl(False)
  946.     Case "cx"                                            '查 询
  947.         Call IncFx(strTemItem)
  948.         If Me.bSeach = True Then
  949.             If DEBUG_FLAG = False Then XT_Wait.Show
  950.             Call FormInit
  951.             Me.bSeach = False
  952.             If DEBUG_FLAG = False Then XT_Wait.Hide
  953.         End If
  954.     Case "bz"                                            '帮 助
  955.         Call F1bz
  956.     Case "fh"                                            '退 出
  957.         Unload Me
  958.     End Select
  959. End Sub
  960. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  961.     If DEBUG_FLAG = False Then On Error Resume Next
  962.     Select Case Button.Key
  963.     Case "bcgs"                                          '保存表格格式
  964.         Call Bcwggs(CxbbGrid, GridCode, GridStr())
  965.     Case "hfmrgs"                                        '恢复默认格式
  966.         Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  967.     Case "szxsxm"                                        '设置显示项目
  968.         Call Szxsxm(CxbbGrid, GridCode)
  969.     End Select
  970. End Sub
  971. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  972.     If DEBUG_FLAG = False Then On Error Resume Next
  973.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  974.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  975.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  976.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  977.     ReDim Bbxbt(1 To Bbxbtgs)
  978.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  979.     If Bbbwhgs <> 0 Then
  980.         ReDim Bbbwh(1 To Bbbwhgs)
  981.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  982.     End If
  983.     Bbzbt = ReportTitle
  984.     bbxbtzzxs(1) = 2                                    '报表行组织形式(0-居左 1-居中 2-居右)
  985.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  986.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  987.     If Not bbylte Then
  988.         Unload DY_Tybbyldy
  989.     End If
  990. End Sub