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

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Begin VB.Form Rep_Tax_Frm 
  5.    Caption         =   "个人所得税申报表"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   315
  8.    ClientTop       =   390
  9.    ClientWidth     =   11820
  10.    HelpContextID   =   2214001
  11.    Icon            =   "报表_个人所得税.frx":0000
  12.    KeyPreview      =   -1  'True
  13.    LinkTopic       =   "Form1"
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11820
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.ProgressBar PB_Proc 
  19.       Height          =   330
  20.       Left            =   2865
  21.       TabIndex        =   6
  22.       Top             =   3735
  23.       Visible         =   0   'False
  24.       Width           =   4440
  25.       _ExtentX        =   7832
  26.       _ExtentY        =   582
  27.       _Version        =   393216
  28.       Appearance      =   1
  29.       Scrolling       =   1
  30.    End
  31.    Begin VB.PictureBox Pic_Title 
  32.       BackColor       =   &H00FFFFFF&
  33.       Height          =   1080
  34.       Left            =   -90
  35.       Picture         =   "报表_个人所得税.frx":1042
  36.       ScaleHeight     =   1020
  37.       ScaleWidth      =   11715
  38.       TabIndex        =   3
  39.       Top             =   600
  40.       Width           =   11775
  41.       Begin VB.Label Lab_Period 
  42.          AutoSize        =   -1  'True
  43.          BackStyle       =   0  'Transparent
  44.          Caption         =   "会计期间:"
  45.          Height          =   180
  46.          Left            =   960
  47.          TabIndex        =   5
  48.          Top             =   720
  49.          Width           =   810
  50.       End
  51.       Begin VB.Label Lab_Title 
  52.          AutoSize        =   -1  'True
  53.          BackColor       =   &H80000018&
  54.          BackStyle       =   0  'Transparent
  55.          Caption         =   "个人所得税申报表"
  56.          BeginProperty Font 
  57.             Name            =   "宋体"
  58.             Size            =   12
  59.             Charset         =   134
  60.             Weight          =   700
  61.             Underline       =   0   'False
  62.             Italic          =   0   'False
  63.             Strikethrough   =   0   'False
  64.          EndProperty
  65.          ForeColor       =   &H00000000&
  66.          Height          =   240
  67.          Index           =   4
  68.          Left            =   405
  69.          TabIndex        =   4
  70.          Top             =   180
  71.          Width           =   2040
  72.       End
  73.    End
  74.    Begin MSComctlLib.Toolbar GsToolbar 
  75.       Height          =   540
  76.       Left            =   9330
  77.       TabIndex        =   1
  78.       Top             =   30
  79.       Width           =   2475
  80.       _ExtentX        =   4366
  81.       _ExtentY        =   953
  82.       ButtonWidth     =   1455
  83.       ButtonHeight    =   953
  84.       Appearance      =   1
  85.       Style           =   1
  86.       ImageList       =   "ImageList1"
  87.       _Version        =   393216
  88.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  89.          NumButtons      =   3
  90.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  91.             Caption         =   "保存格式"
  92.             Key             =   "bcgs"
  93.             ImageKey        =   "bcgs"
  94.          EndProperty
  95.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  96.             Caption         =   "默认列宽"
  97.             Key             =   "hfmrgs"
  98.             ImageKey        =   "mrlk"
  99.          EndProperty
  100.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  101.             Caption         =   "显示项目"
  102.             Key             =   "szxsxm"
  103.             ImageKey        =   "xsxm"
  104.          EndProperty
  105.       EndProperty
  106.    End
  107.    Begin VB.Timer Timer1 
  108.       Enabled         =   0   'False
  109.       Interval        =   1
  110.       Left            =   7620
  111.       Top             =   90
  112.    End
  113.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  114.       Height          =   7260
  115.       Left            =   60
  116.       TabIndex        =   0
  117.       Top             =   1785
  118.       Width           =   11775
  119.       _ExtentX        =   20770
  120.       _ExtentY        =   12806
  121.       Appearance      =   1
  122.       BorderStyle     =   1
  123.       Enabled         =   -1  'True
  124.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  125.          Name            =   "宋体"
  126.          Size            =   9
  127.          Charset         =   134
  128.          Weight          =   400
  129.          Underline       =   0   'False
  130.          Italic          =   0   'False
  131.          Strikethrough   =   0   'False
  132.       EndProperty
  133.       MousePointer    =   0
  134.       BackColor       =   16777215
  135.       ForeColor       =   -2147483640
  136.       BackColorFixed  =   13826538
  137.       ForeColorFixed  =   -2147483630
  138.       BackColorSel    =   -2147483635
  139.       ForeColorSel    =   -2147483634
  140.       BackColorBkg    =   -2147483636
  141.       BackColorAlternate=   16777215
  142.       GridColor       =   -2147483633
  143.       GridColorFixed  =   -2147483632
  144.       TreeColor       =   -2147483632
  145.       FloodColor      =   192
  146.       SheetBorder     =   -2147483642
  147.       FocusRect       =   1
  148.       HighLight       =   1
  149.       AllowSelection  =   -1  'True
  150.       AllowBigSelection=   -1  'True
  151.       AllowUserResizing=   0
  152.       SelectionMode   =   0
  153.       GridLines       =   1
  154.       GridLinesFixed  =   2
  155.       GridLineWidth   =   1
  156.       Rows            =   50
  157.       Cols            =   10
  158.       FixedRows       =   1
  159.       FixedCols       =   1
  160.       RowHeightMin    =   0
  161.       RowHeightMax    =   0
  162.       ColWidthMin     =   0
  163.       ColWidthMax     =   0
  164.       ExtendLastCol   =   0   'False
  165.       FormatString    =   ""
  166.       ScrollTrack     =   0   'False
  167.       ScrollBars      =   3
  168.       ScrollTips      =   0   'False
  169.       MergeCells      =   0
  170.       MergeCompare    =   0
  171.       AutoResize      =   -1  'True
  172.       AutoSizeMode    =   0
  173.       AutoSearch      =   0
  174.       MultiTotals     =   -1  'True
  175.       SubtotalPosition=   1
  176.       OutlineBar      =   0
  177.       OutlineCol      =   0
  178.       Ellipsis        =   0
  179.       ExplorerBar     =   0
  180.       PicturesOver    =   0   'False
  181.       FillStyle       =   0
  182.       RightToLeft     =   0   'False
  183.       PictureType     =   0
  184.       TabBehavior     =   0
  185.       OwnerDraw       =   0
  186.       Editable        =   0   'False
  187.       ShowComboButton =   -1  'True
  188.       WordWrap        =   0   'False
  189.       TextStyle       =   0
  190.       TextStyleFixed  =   0
  191.       OleDragMode     =   0
  192.       OleDropMode     =   0
  193.       DataMode        =   0
  194.       VirtualData     =   -1  'True
  195.    End
  196.    Begin MSComctlLib.Toolbar SzToolbar 
  197.       Align           =   1  'Align Top
  198.       Height          =   570
  199.       Left            =   0
  200.       TabIndex        =   2
  201.       Top             =   0
  202.       Width           =   11820
  203.       _ExtentX        =   20849
  204.       _ExtentY        =   1005
  205.       ButtonWidth     =   820
  206.       ButtonHeight    =   953
  207.       AllowCustomize  =   0   'False
  208.       Appearance      =   1
  209.       Style           =   1
  210.       ImageList       =   "ImageList1"
  211.       _Version        =   393216
  212.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  213.          NumButtons      =   12
  214.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  215.             Caption         =   "设置"
  216.             Key             =   "ymsz"
  217.             Object.ToolTipText     =   "设置打印参数"
  218.             ImageKey        =   "sz"
  219.          EndProperty
  220.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  221.             Caption         =   "打印"
  222.             Key             =   "dy"
  223.             Object.ToolTipText     =   "打印当前数据"
  224.             ImageKey        =   "dy"
  225.          EndProperty
  226.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  227.             Caption         =   "预览"
  228.             Key             =   "yl"
  229.             Object.ToolTipText     =   "显示当前数据的打印模式"
  230.             ImageKey        =   "yl"
  231.          EndProperty
  232.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  233.             Style           =   3
  234.          EndProperty
  235.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  236.             Caption         =   "查询"
  237.             Key             =   "cx"
  238.             Object.ToolTipText     =   "以某种条件取得数据"
  239.             ImageKey        =   "cx"
  240.          EndProperty
  241.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  242.             Caption         =   "刷新"
  243.             Key             =   "Refresh"
  244.             Object.ToolTipText     =   "以当前条件重新取得数据"
  245.             ImageKey        =   "sx"
  246.          EndProperty
  247.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  248.             Style           =   3
  249.          EndProperty
  250.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  251.             Caption         =   "明细"
  252.             Key             =   "Detail"
  253.             Object.ToolTipText     =   "显示每个人员的信息"
  254.             ImageKey        =   "Detail"
  255.             Style           =   1
  256.             Value           =   1
  257.          EndProperty
  258.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  259.             Caption         =   "合计"
  260.             Key             =   "Total"
  261.             Object.ToolTipText     =   "显示合计信息"
  262.             ImageKey        =   "Total"
  263.             Style           =   1
  264.             Value           =   1
  265.          EndProperty
  266.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  267.             Style           =   3
  268.          EndProperty
  269.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  270.             Caption         =   "帮助"
  271.             Key             =   "bz"
  272.             Object.ToolTipText     =   "显示帮助信息"
  273.             ImageKey        =   "bz"
  274.          EndProperty
  275.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  276.             Caption         =   "退出"
  277.             Key             =   "fh"
  278.             Object.ToolTipText     =   "退出个人所得税申报表"
  279.             ImageKey        =   "tc"
  280.          EndProperty
  281.       EndProperty
  282.       BorderStyle     =   1
  283.       Begin MSComctlLib.ImageList ImageList1 
  284.          Left            =   5280
  285.          Top             =   0
  286.          _ExtentX        =   1005
  287.          _ExtentY        =   1005
  288.          BackColor       =   -2147483643
  289.          ImageWidth      =   16
  290.          ImageHeight     =   16
  291.          MaskColor       =   12632256
  292.          _Version        =   393216
  293.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  294.             NumListImages   =   35
  295.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  296.                Picture         =   "报表_个人所得税.frx":35106
  297.                Key             =   "sz"
  298.             EndProperty
  299.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  300.                Picture         =   "报表_个人所得税.frx":354A0
  301.                Key             =   "dy"
  302.             EndProperty
  303.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  304.                Picture         =   "报表_个人所得税.frx":3583A
  305.                Key             =   "yl"
  306.             EndProperty
  307.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  308.                Picture         =   "报表_个人所得税.frx":35BD4
  309.                Key             =   "xg"
  310.             EndProperty
  311.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  312.                Picture         =   "报表_个人所得税.frx":35F6E
  313.                Key             =   "zh"
  314.             EndProperty
  315.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  316.                Picture         =   "报表_个人所得税.frx":36308
  317.                Key             =   "sh"
  318.             EndProperty
  319.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  320.                Picture         =   "报表_个人所得税.frx":366A2
  321.                Key             =   "bc"
  322.             EndProperty
  323.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  324.                Picture         =   "报表_个人所得税.frx":36A3C
  325.                Key             =   "fq"
  326.             EndProperty
  327.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  328.                Picture         =   "报表_个人所得税.frx":36DD6
  329.                Key             =   "bz"
  330.             EndProperty
  331.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  332.                Picture         =   "报表_个人所得税.frx":37170
  333.                Key             =   "tc"
  334.             EndProperty
  335.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  336.                Picture         =   "报表_个人所得税.frx":3750A
  337.                Key             =   "bcgs"
  338.             EndProperty
  339.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  340.                Picture         =   "报表_个人所得税.frx":378A4
  341.                Key             =   "mrlk"
  342.             EndProperty
  343.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  344.                Picture         =   "报表_个人所得税.frx":37C3E
  345.                Key             =   "xsxm"
  346.             EndProperty
  347.             BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  348.                Picture         =   "报表_个人所得税.frx":37FD8
  349.                Key             =   "first"
  350.             EndProperty
  351.             BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  352.                Picture         =   "报表_个人所得税.frx":38372
  353.                Key             =   "prev"
  354.             EndProperty
  355.             BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  356.                Picture         =   "报表_个人所得税.frx":3870C
  357.                Key             =   "next"
  358.             EndProperty
  359.             BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  360.                Picture         =   "报表_个人所得税.frx":38AA6
  361.                Key             =   "last"
  362.             EndProperty
  363.             BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  364.                Picture         =   "报表_个人所得税.frx":38E40
  365.                Key             =   "xx"
  366.             EndProperty
  367.             BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  368.                Picture         =   "报表_个人所得税.frx":391DA
  369.                Key             =   "define"
  370.             EndProperty
  371.             BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  372.                Picture         =   "报表_个人所得税.frx":39574
  373.                Key             =   "exec"
  374.             EndProperty
  375.             BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  376.                Picture         =   "报表_个人所得税.frx":3990E
  377.                Key             =   "xz"
  378.             EndProperty
  379.             BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  380.                Picture         =   "报表_个人所得税.frx":39CA8
  381.                Key             =   "sc"
  382.             EndProperty
  383.             BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  384.                Picture         =   "报表_个人所得税.frx":3A042
  385.                Key             =   "sx"
  386.             EndProperty
  387.             BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  388.                Picture         =   "报表_个人所得税.frx":3A3DC
  389.                Key             =   "cx"
  390.             EndProperty
  391.             BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  392.                Picture         =   "报表_个人所得税.frx":3A776
  393.                Key             =   "zd"
  394.             EndProperty
  395.             BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  396.                Picture         =   "报表_个人所得税.frx":3AB10
  397.                Key             =   "dz"
  398.             EndProperty
  399.             BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  400.                Picture         =   "报表_个人所得税.frx":3AEAA
  401.                Key             =   "ph"
  402.             EndProperty
  403.             BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  404.                Picture         =   "报表_个人所得税.frx":3B244
  405.                Key             =   "fz"
  406.             EndProperty
  407.             BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  408.                Picture         =   "报表_个人所得税.frx":3B5DE
  409.                Key             =   "dw"
  410.             EndProperty
  411.             BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  412.                Picture         =   "报表_个人所得税.frx":3B978
  413.                Key             =   "hf"
  414.             EndProperty
  415.             BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  416.                Picture         =   "报表_个人所得税.frx":3BD12
  417.                Key             =   "pz"
  418.             EndProperty
  419.             BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  420.                Picture         =   "报表_个人所得税.frx":3C0AC
  421.                Key             =   "check"
  422.             EndProperty
  423.             BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  424.                Picture         =   "报表_个人所得税.frx":3C446
  425.                Key             =   "Sum"
  426.             EndProperty
  427.             BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  428.                Picture         =   "报表_个人所得税.frx":3C7E0
  429.                Key             =   "Total"
  430.             EndProperty
  431.             BeginProperty ListImage35 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  432.                Picture         =   "报表_个人所得税.frx":3CB7A
  433.                Key             =   "Detail"
  434.             EndProperty
  435.          EndProperty
  436.       End
  437.    End
  438. End
  439. Attribute VB_Name = "Rep_Tax_Frm"
  440. Attribute VB_GlobalNameSpace = False
  441. Attribute VB_Creatable = False
  442. Attribute VB_PredeclaredId = True
  443. Attribute VB_Exposed = False
  444. '**************************************************************************
  445. '*    模 块 名 称 :个人所得税
  446. '*    功 能 描 述 :
  447. '*    程序员姓名  :苗鹏
  448. '*    最后修改人  :苗鹏
  449. '*    最后修改时间:2002/01/01
  450. '*    备        注:
  451. '**************************************************************************
  452. Dim ReportTitle As String                '报表主标题
  453. Public sSqlWhere As String
  454. Public sSqlFrom As String
  455. Public sPeriod As String
  456. '以下为固定使用变量
  457. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  458. Dim GridCode As String                   '显示网格网格代码
  459. Dim GridInf() As Variant                 '整个网格设置信息
  460. Dim Tsxx As String                       '系统提示信息
  461. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  462. Dim Sjhgd As Double                      '网格数据行高度
  463. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  464. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  465. Dim GridStr()  As String                 '网格列信息(字符型)
  466. Dim GridInt() As Integer                 '网格列信息(整型)
  467. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  468. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小(Fixed)
  469.     On Error Resume Next
  470.     With CxbbGrid
  471.         .Width = Me.Width - 160
  472.         .Height = Me.Height - .Top - 400
  473.     End With
  474.     With Pic_Title
  475.         .Width = Me.Width - 160
  476.     End With
  477.     
  478.     GsToolbar.Left = Me.Width - GsToolbar.Width - 140
  479.     With Me.PB_Proc
  480.         .Left = (Me.Width - .Width) / 2
  481.         .Top = Me.Height / 2
  482.     End With
  483.     
  484. End Sub
  485. Private Sub Form_Load()                                                   '窗体装入
  486.     On Error GoTo ErrCtrl
  487.     '调入打印页面设置窗体
  488.     ReportTitle = "个人所得税申报表"
  489.     XtReportCode = "PM_Tax"
  490.     Load Dyymctbl
  491.     
  492.     '调整标题栏及网格、格式工具条位置(Fixed)
  493.     Pic_Title.Left = 40
  494.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  495.     CxbbGrid.Left = Pic_Title.Left
  496.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  497.     
  498.     '调 入 网 格(Fixed)
  499.     GridCode = "PM_Tax"
  500.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  501.     
  502.     Qslz = GridInf(1)
  503.     Sjhgd = GridInf(2)
  504.     Sfxshjwg = GridInf(7)
  505.     Szzls = CxbbGrid.Cols - 1
  506.     Exit Sub
  507. ErrCtrl:
  508.     Set Dyymctbl = Nothing
  509.     MsgBox "初始化错误!", vbOKOnly + vbCritical
  510.     Unload Me
  511. End Sub
  512. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  513.         
  514.     '卸载打印页面设置窗体
  515.     Unload Dyymctbl
  516.     Set Dyymctbl = Nothing
  517.     Security_Log "Pm_Tax", Xtczybm, 2, False  '用户退出时写上机日志
  518. End Sub
  519. Private Sub CxbbGrid_BeforeMoveColumn(ByVal Col As Long, Position As Long)           '网格列发生移动时自动交换网格索引信息
  520.     Call FnBln_RefreshArray(Col, Position, GridStr(), GridInf())
  521. End Sub
  522. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)                '网格格式调整(Fixed)
  523.     
  524.     Select Case Button.Key
  525.     Case "bcgs"                                          '保存表格格式
  526.         Call Bcwggs(CxbbGrid, GridCode, GridStr())
  527.     Case "hfmrgs"                                        '恢复默认格式
  528.         Call Hfmrgs(CxbbGrid, GridCode, GridStr())
  529.     Case "szxsxm"                                        '设置显示项目
  530.         Call Szxsxm(CxbbGrid, GridCode)
  531.     End Select
  532.     
  533. End Sub
  534. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  535.     On Error Resume Next
  536.     Dim frm As Form
  537.     Select Case Button.Key
  538.     Case "ymsz"                                          '页面设置
  539.         Dyymctbl.Show 1
  540.     Case "yl"                                            '预 览
  541.         Call bbyl(True)
  542.     Case "dy"                                            '打 印
  543.         Call bbyl(False)
  544.     Case "cx"                                            '查 询
  545.         Set frm = New Query_Tax_Frm
  546.         With frm
  547.             .sTableName = "PM_TaxData"
  548.             Set .frmParent = Me
  549.             .Show 1
  550.         End With
  551.         Set frm = Nothing
  552.     Case "Refresh"      '刷新数据
  553.         ShowRecord sSqlWhere, sSqlFrom
  554.     Case "Detail" '明细
  555.         With Me.CxbbGrid
  556.             If Me.SzToolbar.Buttons("Detail").Value = tbrUnpressed Then
  557.                 For i = .FixedRows To .Rows - 2
  558.                     If .TextMatrix(i, 0) <> "小计" And .TextMatrix(i, 0) <> "合计" Then
  559.                         .RowHidden(i) = True
  560.                     End If
  561.                 Next i
  562.             Else
  563.                 For i = .FixedRows To .Rows - 2
  564.                     If .TextMatrix(i, 0) <> "小计" And .TextMatrix(i, 0) <> "合计" Then
  565.                         .RowHidden(i) = False
  566.                     End If
  567.                 Next i
  568.               
  569.             End If
  570.         End With
  571.     Case "Total" '合计
  572.         With Me.CxbbGrid
  573.           If .FixedRows = .Rows Then Exit Sub
  574.           If Me.SzToolbar.Buttons("Total").Value = tbrUnpressed Then
  575.             For i = .FixedRows To .Rows - 1
  576.               If .TextMatrix(i, 0) = "小计:" Or .TextMatrix(i, 0) = "合计:" Then
  577.                 .RowHidden(i) = True
  578.                 
  579.               End If
  580.             Next i
  581.           Else
  582.             For i = .FixedRows To .Rows - 1
  583.               If .TextMatrix(i, 0) = "小计:" Or .TextMatrix(i, 0) = "合计:" Then
  584.                 .RowHidden(i) = False
  585.               End If
  586.             Next i
  587.           End If
  588.         End With
  589.     Case "bz"                                            '帮 助
  590.         Call F1bz
  591.     Case "fh"                                            '退 出
  592.         Unload Me
  593.     End Select
  594.     
  595. End Sub
  596. Public Function ShowRecord(sWhere As String, sFrom As String)                                    '生成查询结果(Define)
  597.     On Error GoTo ErrCtrl
  598.     
  599.     Me.MousePointer = 11 'busy
  600.     Me.Lab_Period.Caption = "会计期间:" & Me.sPeriod
  601.     If Trim(sWhere) = "" Or Trim(sFrom) = "" Then
  602.         Me.MousePointer = 0
  603.         Exit Function
  604.     End If
  605.     
  606.     Dim rs As New ADODB.Recordset
  607.     Dim s As String
  608.     Dim i As Integer
  609.     '条件
  610.     s = "Select EmpNo=(select EmpNo from Rs_BasicInfo a where a.EmpID=PM_TaxData.EmpID) " & Chr(10) _
  611.         & ",EmpName=(select EmpName from Rs_BasicInfo a where a.EmpID=PM_TaxData.EmpID ) " & Chr(10) _
  612.         & ",PM_TaxData.* " & Chr(10) _
  613.         & sFrom & Chr(10) & sWhere
  614.     Set rs = Cw_DataEnvi.DataConnect.Execute(s)
  615.     
  616.     With Me.CxbbGrid
  617.         .Redraw = False
  618.         .Rows = .FixedRows + rs.RecordCount
  619.         '进度和标题
  620.         If rs.RecordCount <> 0 Then
  621.             Me.Lab_Period.Caption = "会计期间:" & rs!KjYear & "年" & rs!Period & "月"
  622.             Me.PB_Proc.Min = 0
  623.             Me.PB_Proc.Max = rs.RecordCount + 1
  624.             Me.PB_Proc.Value = 0
  625.             Me.PB_Proc.Visible = True
  626.         End If
  627.         '数据
  628.         For i = .FixedRows To .Rows - 1
  629.             Me.PB_Proc.Value = (Me.PB_Proc.Value + 1) Mod Me.PB_Proc.Max
  630.             .TextMatrix(i, Sydz("001", GridStr(), Szzls)) = Trim(rs.Fields("EmpNo") & "")       '工号
  631.             .TextMatrix(i, Sydz("002", GridStr(), Szzls)) = Trim(rs.Fields("EmpName") & "")     '姓名
  632.             .TextMatrix(i, Sydz("003", GridStr(), Szzls)) = Trim(rs.Fields("IncomeSum") & "")   '收入合计
  633.             .TextMatrix(i, Sydz("004", GridStr(), Szzls)) = Trim(rs.Fields("DeductNum") & "")   '扣除数
  634.             .TextMatrix(i, Sydz("005", GridStr(), Szzls)) = Trim(rs.Fields("IncomeTaxNum") & "")    '应纳税所得额
  635.             .TextMatrix(i, Sydz("006", GridStr(), Szzls)) = Trim(rs.Fields("TaxRate") & "")         '税率
  636.             .TextMatrix(i, Sydz("007", GridStr(), Szzls)) = Val(Trim(rs.Fields("IncomeTaxNum") & "")) * Val(Trim(rs.Fields("TaxRate") & "")) / 100  '总纳税额
  637.             .TextMatrix(i, Sydz("008", GridStr(), Szzls)) = Trim(rs.Fields("QuickDeduct") & "")     '速算扣除数
  638.             .TextMatrix(i, Sydz("009", GridStr(), Szzls)) = Trim(rs.Fields("Tax") & "")             '应纳税额
  639.             .TextMatrix(i, Sydz("010", GridStr(), Szzls)) = Trim(rs.Fields("CertNo") & "")          '纳税凭字
  640.             rs.MoveNext
  641.         Next i
  642.         rs.Close
  643.         Set rs = Nothing
  644.         '合计
  645.         .SubtotalPosition = flexSTBelow
  646.         .Subtotal flexSTSum, -1, Sydz("003", GridStr(), Szzls), "#,##0.00", &HF7F3EC, , , "合计:"
  647.         .Subtotal flexSTSum, -1, Sydz("004", GridStr(), Szzls), "#,##0.00", &HF7F3EC, , , "合计:"
  648.         .Subtotal flexSTSum, -1, Sydz("005", GridStr(), Szzls), "#,##0.00", &HF7F3EC, , , "合计:"
  649.         .Subtotal flexSTSum, -1, Sydz("007", GridStr(), Szzls), "#,##0.00", &HF7F3EC, , , "合计:"
  650.         .Subtotal flexSTSum, -1, Sydz("008", GridStr(), Szzls), "#,##0.00", &HF7F3EC, , , "合计:"
  651.         .Subtotal flexSTSum, -1, Sydz("009", GridStr(), Szzls), "#,##0.00", &HF7F3EC, , , "合计:"
  652.         Me.PB_Proc.Visible = False
  653.         .Redraw = True
  654.     End With
  655.     Me.MousePointer = 0
  656.     Exit Function
  657. ErrCtrl:
  658.     If rs.State = 1 Then
  659.         rs.Close
  660.     End If
  661.     Set rs = Nothing
  662.     Me.MousePointer = 0
  663. End Function
  664. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  665.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  666.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  667.     Bbxbtgs = 2                                         '报 表 小 标 题 行 数
  668.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  669.     ReDim Bbxbt(1 To Bbxbtgs)
  670.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  671.     If Bbbwhgs <> 0 Then
  672.         ReDim Bbbwh(1 To Bbbwhgs)
  673.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  674.     End If
  675.     Bbzbt = ReportTitle
  676.     Bbxbt(2) = Me.Lab_Period.Caption
  677.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  678.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  679.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  680.     If Not bbylte Then
  681.         Unload DY_Tybbyldy
  682.     End If
  683. End Sub