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

企业管理

开发平台:

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 Book_VariList 
  5.    Caption         =   "固定资产变动报表"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   11880
  10.    HelpContextID   =   505002
  11.    Icon            =   "资产变动报表.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11880
  17.    Begin VB.Timer Timer1 
  18.       Enabled         =   0   'False
  19.       Interval        =   1
  20.       Left            =   6533
  21.       Top             =   60
  22.    End
  23.    Begin VB.PictureBox Pic_Title 
  24.       BackColor       =   &H00FFFFFF&
  25.       Height          =   825
  26.       Left            =   -7
  27.       Picture         =   "资产变动报表.frx":1042
  28.       ScaleHeight     =   765
  29.       ScaleWidth      =   11835
  30.       TabIndex        =   0
  31.       Top             =   570
  32.       Width           =   11895
  33.       Begin MSComctlLib.ImageList ImageList1 
  34.          Left            =   5370
  35.          Top             =   0
  36.          _ExtentX        =   1005
  37.          _ExtentY        =   1005
  38.          BackColor       =   -2147483643
  39.          ImageWidth      =   16
  40.          ImageHeight     =   16
  41.          MaskColor       =   12632256
  42.          _Version        =   393216
  43.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  44.             NumListImages   =   11
  45.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  46.                Picture         =   "资产变动报表.frx":35106
  47.                Key             =   "sz"
  48.             EndProperty
  49.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  50.                Picture         =   "资产变动报表.frx":354A0
  51.                Key             =   "dy"
  52.             EndProperty
  53.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  54.                Picture         =   "资产变动报表.frx":3583A
  55.                Key             =   "yl"
  56.             EndProperty
  57.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  58.                Picture         =   "资产变动报表.frx":35BD4
  59.                Key             =   "bz"
  60.             EndProperty
  61.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  62.                Picture         =   "资产变动报表.frx":35F6E
  63.                Key             =   "tc"
  64.             EndProperty
  65.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  66.                Picture         =   "资产变动报表.frx":36308
  67.                Key             =   "bcgs"
  68.             EndProperty
  69.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  70.                Picture         =   "资产变动报表.frx":366A2
  71.                Key             =   "mrlk"
  72.             EndProperty
  73.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  74.                Picture         =   "资产变动报表.frx":36A3C
  75.                Key             =   "xsxm"
  76.             EndProperty
  77.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  78.                Picture         =   "资产变动报表.frx":36DD6
  79.                Key             =   "cx"
  80.             EndProperty
  81.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  82.                Picture         =   "资产变动报表.frx":37170
  83.                Key             =   "dj"
  84.             EndProperty
  85.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  86.                Picture         =   "资产变动报表.frx":3750A
  87.                Key             =   "bd"
  88.             EndProperty
  89.          EndProperty
  90.       End
  91.       Begin VB.Label tsLabel 
  92.          AutoSize        =   -1  'True
  93.          BackColor       =   &H80000018&
  94.          BackStyle       =   0  'Transparent
  95.          Caption         =   "固定资产变动单据列表"
  96.          BeginProperty Font 
  97.             Name            =   "宋体"
  98.             Size            =   12
  99.             Charset         =   134
  100.             Weight          =   700
  101.             Underline       =   0   'False
  102.             Italic          =   0   'False
  103.             Strikethrough   =   0   'False
  104.          EndProperty
  105.          ForeColor       =   &H00000000&
  106.          Height          =   240
  107.          Index           =   4
  108.          Left            =   525
  109.          TabIndex        =   1
  110.          Top             =   240
  111.          Width           =   2550
  112.       End
  113.    End
  114.    Begin VSFlex8Ctl.VSFlexGrid CxbbGrid 
  115.       Height          =   7215
  116.       Left            =   -7
  117.       TabIndex        =   2
  118.       Top             =   1440
  119.       Width           =   11895
  120.       _cx             =   5080
  121.       _cy             =   5080
  122.       Appearance      =   1
  123.       BorderStyle     =   1
  124.       Enabled         =   -1  'True
  125.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  126.          Name            =   "宋体"
  127.          Size            =   9
  128.          Charset         =   134
  129.          Weight          =   400
  130.          Underline       =   0   'False
  131.          Italic          =   0   'False
  132.          Strikethrough   =   0   'False
  133.       EndProperty
  134.       MousePointer    =   0
  135.       BackColor       =   -2147483643
  136.       ForeColor       =   -2147483640
  137.       BackColorFixed  =   -2147483633
  138.       ForeColorFixed  =   -2147483630
  139.       BackColorSel    =   -2147483635
  140.       ForeColorSel    =   -2147483634
  141.       BackColorBkg    =   -2147483636
  142.       BackColorAlternate=   -2147483643
  143.       GridColor       =   -2147483633
  144.       GridColorFixed  =   -2147483632
  145.       TreeColor       =   -2147483632
  146.       FloodColor      =   192
  147.       SheetBorder     =   -2147483642
  148.       FocusRect       =   1
  149.       HighLight       =   1
  150.       AllowSelection  =   -1  'True
  151.       AllowBigSelection=   -1  'True
  152.       AllowUserResizing=   0
  153.       SelectionMode   =   0
  154.       GridLines       =   1
  155.       GridLinesFixed  =   2
  156.       GridLineWidth   =   1
  157.       Rows            =   50
  158.       Cols            =   10
  159.       FixedRows       =   1
  160.       FixedCols       =   1
  161.       RowHeightMin    =   0
  162.       RowHeightMax    =   0
  163.       ColWidthMin     =   0
  164.       ColWidthMax     =   0
  165.       ExtendLastCol   =   0   'False
  166.       FormatString    =   ""
  167.       ScrollTrack     =   0   'False
  168.       ScrollBars      =   3
  169.       ScrollTips      =   0   'False
  170.       MergeCells      =   0
  171.       MergeCompare    =   0
  172.       AutoResize      =   -1  'True
  173.       AutoSizeMode    =   0
  174.       AutoSearch      =   0
  175.       AutoSearchDelay =   2
  176.       MultiTotals     =   -1  'True
  177.       SubtotalPosition=   1
  178.       OutlineBar      =   0
  179.       OutlineCol      =   0
  180.       Ellipsis        =   0
  181.       ExplorerBar     =   0
  182.       PicturesOver    =   0   'False
  183.       FillStyle       =   0
  184.       RightToLeft     =   0   'False
  185.       PictureType     =   0
  186.       TabBehavior     =   0
  187.       OwnerDraw       =   0
  188.       Editable        =   0
  189.       ShowComboButton =   1
  190.       WordWrap        =   0   'False
  191.       TextStyle       =   0
  192.       TextStyleFixed  =   0
  193.       OleDragMode     =   0
  194.       OleDropMode     =   0
  195.       DataMode        =   0
  196.       VirtualData     =   -1  'True
  197.       DataMember      =   ""
  198.       ComboSearch     =   3
  199.       AutoSizeMouse   =   -1  'True
  200.       FrozenRows      =   0
  201.       FrozenCols      =   0
  202.       AllowUserFreezing=   0
  203.       BackColorFrozen =   0
  204.       ForeColorFrozen =   0
  205.       WallPaperAlignment=   9
  206.       AccessibleName  =   ""
  207.       AccessibleDescription=   ""
  208.       AccessibleValue =   ""
  209.       AccessibleRole  =   24
  210.    End
  211.    Begin MSComctlLib.Toolbar GsToolbar 
  212.       Height          =   525
  213.       Left            =   9390
  214.       TabIndex        =   3
  215.       Top             =   30
  216.       Width           =   2475
  217.       _ExtentX        =   4366
  218.       _ExtentY        =   926
  219.       ButtonWidth     =   1455
  220.       ButtonHeight    =   926
  221.       Appearance      =   1
  222.       Style           =   1
  223.       ImageList       =   "ImageList1"
  224.       _Version        =   393216
  225.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  226.          NumButtons      =   3
  227.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  228.             Caption         =   "保存格式"
  229.             Key             =   "bcgs"
  230.             ImageKey        =   "bcgs"
  231.          EndProperty
  232.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  233.             Caption         =   "默认列宽"
  234.             Key             =   "hfmrgs"
  235.             ImageKey        =   "mrlk"
  236.          EndProperty
  237.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  238.             Caption         =   "显示项目"
  239.             Key             =   "szxsxm"
  240.             ImageKey        =   "xsxm"
  241.          EndProperty
  242.       EndProperty
  243.    End
  244.    Begin MSComctlLib.Toolbar SzToolbar 
  245.       Align           =   1  'Align Top
  246.       Height          =   555
  247.       Left            =   0
  248.       TabIndex        =   4
  249.       Top             =   0
  250.       Width           =   11880
  251.       _ExtentX        =   20955
  252.       _ExtentY        =   979
  253.       ButtonWidth     =   820
  254.       ButtonHeight    =   926
  255.       AllowCustomize  =   0   'False
  256.       Appearance      =   1
  257.       Style           =   1
  258.       ImageList       =   "ImageList1"
  259.       _Version        =   393216
  260.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  261.          NumButtons      =   11
  262.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  263.             Caption         =   "设置"
  264.             Key             =   "ymsz"
  265.             ImageKey        =   "sz"
  266.          EndProperty
  267.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  268.             Caption         =   "打印"
  269.             Key             =   "dy"
  270.             ImageKey        =   "dy"
  271.          EndProperty
  272.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  273.             Caption         =   "预览"
  274.             Key             =   "yl"
  275.             ImageKey        =   "yl"
  276.          EndProperty
  277.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  278.             Style           =   4
  279.          EndProperty
  280.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  281.             Caption         =   "卡片"
  282.             Key             =   "kp"
  283.             ImageKey        =   "dj"
  284.          EndProperty
  285.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  286.             Caption         =   "变动"
  287.             Key             =   "bd"
  288.             ImageKey        =   "bd"
  289.          EndProperty
  290.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  291.             Style           =   4
  292.          EndProperty
  293.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  294.             Caption         =   "查询"
  295.             Key             =   "cx"
  296.             ImageKey        =   "cx"
  297.          EndProperty
  298.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  299.             Style           =   4
  300.          EndProperty
  301.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  302.             Caption         =   "帮助"
  303.             Key             =   "bz"
  304.             ImageKey        =   "bz"
  305.          EndProperty
  306.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  307.             Caption         =   "退出"
  308.             Key             =   "fh"
  309.             ImageKey        =   "tc"
  310.          EndProperty
  311.       EndProperty
  312.       BorderStyle     =   1
  313.       Begin VB.TextBox Txt_Bit 
  314.          Height          =   270
  315.          Left            =   5070
  316.          TabIndex        =   5
  317.          Text            =   "Text1"
  318.          Top             =   1230
  319.          Visible         =   0   'False
  320.          Width           =   1035
  321.       End
  322.    End
  323. End
  324. Attribute VB_Name = "Book_VariList"
  325. Attribute VB_GlobalNameSpace = False
  326. Attribute VB_Creatable = False
  327. Attribute VB_PredeclaredId = True
  328. Attribute VB_Exposed = False
  329. '**************************************************************************
  330. '*    模 块 名 称 :资产变动报表
  331. '*    功 能 描 述 :
  332. '*    程序员姓名  :徐衍民
  333. '*    最后修改人  :徐衍民
  334. '*    最后修改时间:2001/12/12
  335. '*    备        注:
  336. '**************************************************************************
  337. Dim ReportTitle As String                '报表主标题
  338. Dim Card_Str As String                   '用户录入查询条件
  339. Dim rstemp As ADODB.Recordset            '打开数据集变量
  340. '以下为固定使用变量
  341. Dim Dyymctbl As New DY_Dyymsz            '打印页面窗体变量
  342. Dim GridCode As String                   '显示网格网格代码
  343. Dim GridInf() As Variant                 '整个网格设置信息
  344. Dim Tsxx As String                       '系统提示信息
  345. Dim Qslz As Long                         '网格隐藏(非操作显示)列数
  346. Dim Sjhgd As Double                      '网格数据行高度
  347. Dim Sfxshjwg As Boolean                  '是否显示合计网格
  348. Dim GridBoolean() As Boolean             '网格列信息(布尔型)
  349. Dim GridStr()  As String                 '网格列信息(字符型)
  350. Dim GridInt() As Integer                 '网格列信息(整型)
  351. Dim Szzls As Integer                     '数组总列数(网格列数-1)
  352. Private Sub CxbbGrid_DblClick()          '双击数据行进入资产变动单窗体
  353.     
  354.     If CxbbGrid.Row > 0 Then
  355.         Book_Vari.Lbl_Num.Caption = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 1))
  356.         Book_Vari.Show
  357.     End If
  358.     
  359. End Sub
  360. Private Sub Form_Activate()              '保持窗体最大化
  361.     Me.WindowState = 2
  362. End Sub
  363. Private Sub Form_Resize()                '根据窗体大小来调整网格,标题栏大小
  364.     
  365.     On Error Resume Next
  366.     
  367.     With CxbbGrid
  368.         .Width = Me.Width - 160
  369.         .Height = Me.Height - .Top - 400
  370.     End With
  371.     
  372.     With Pic_Title
  373.         .Width = Me.Width - 160
  374.     End With
  375.     
  376.     GsToolbar.Left = Me.Width - GsToolbar.Width - 160
  377. End Sub
  378. Private Sub Form_Load()                                                   '窗体装入
  379.      
  380.     '调入打印页面设置窗体
  381.     ReportTitle = "固定资产变动报表"
  382.     XtReportCode = "Gdzc_Book_VariList"
  383.     Load Dyymctbl
  384.      
  385.     '调整标题栏及网格、格式工具条位置
  386.     Pic_Title.Left = 40
  387.     Pic_Title.Top = SzToolbar.Top + SzToolbar.Height - 10
  388.     CxbbGrid.Left = Pic_Title.Left
  389.     CxbbGrid.Top = Pic_Title.Top + Pic_Title.Height + 20
  390.     
  391.     '调 入 网 格
  392.     GridCode = "Gdzc_Book_VariList"
  393.     Call BzWgcsh(CxbbGrid, GridCode, GridInf(), GridBoolean(), GridInt(), GridStr())
  394.      
  395.     Qslz = GridInf(1)
  396.     Sjhgd = GridInf(2)
  397.     Sfxshjwg = GridInf(7)
  398.     Szzls = CxbbGrid.Cols - 1
  399. End Sub
  400. Private Sub Form_Unload(Cancel As Integer)                                  '窗体卸载
  401.     
  402.     '卸载条件窗体
  403.     Book_Vari_Search.UnloadCheck.Value = 1
  404.     Unload Book_Vari_Search
  405.     '卸载打印页面设置窗体
  406.     Unload Dyymctbl
  407. End Sub
  408. Private Sub GsToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)       '网格格式调整
  409.     
  410.     Select Case Button.Key
  411.         Case "bcgs"                                          '保存表格格式
  412.           Call Bcwggs(CxbbGrid, GridCode, GridStr)
  413.         Case "hfmrgs"                                        '恢复默认格式
  414.           Call Hfmrgs(CxbbGrid, GridCode, GridStr)
  415.         Case "szxsxm"                                        '设置显示项目
  416.           Call Szxsxm(CxbbGrid, GridCode)
  417.     End Select
  418. End Sub
  419. Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  420.     
  421.     Select Case Button.Key
  422.         Case "ymsz"                                          '页面设置
  423.             Dyymctbl.Show 1
  424.         Case "yl"                                            '预 览
  425.             Call bbyl(True)
  426.         Case "dy"                                            '打 印
  427.             Call bbyl(False)
  428.         Case "cx"                                            '查 询
  429.             Book_Vari_Search.Show 1
  430.         Case "kp"
  431.             If CxbbGrid.Rows <= CxbbGrid.FixedRows Then
  432.                 Kpgl_jbcz.str_CardNumber = Trim(CxbbGrid.TextMatrix(CxbbGrid.Row, 1))
  433.                 Kpgl_jbcz.str_State = "4"
  434.                 Kpgl_jbcz.Show 1
  435.             End If
  436.         Case "bd"
  437.             CxbbGrid_DblClick
  438.         Case "fh"                                            '退 出
  439.             Unload Me
  440.         Case "bz"
  441.             SendKeys "{F1}"
  442.      End Select
  443.      
  444. End Sub
  445. Private Sub Timer1_Timer()                                 '在窗体激活后调入查询程序
  446.     
  447.     Timer1.Enabled = False
  448.     Xt_Wait.Show
  449.     Xt_Wait.Refresh
  450.     
  451.     '加快显示速度
  452.     CxbbGrid.Redraw = False
  453.     
  454.     '生成查询结果
  455.     Call Sub_Query
  456.     
  457.     CxbbGrid.Redraw = True
  458.      
  459.     Xt_Wait.Hide
  460.     
  461. End Sub
  462. Private Sub Sub_Query()                                    '生成查询结果
  463.     
  464.     Dim Rec_Query As New ADODB.Recordset        '查询结果动态集
  465.     Dim Sqlstr As String                        '查询字符串
  466.     Dim Coljsq As Long                          '网格列计数器
  467.     Dim Jsqte As Integer                        '临时动态计数器
  468.     '以下为自定义部分[
  469.     With Book_Vari_Search
  470.         '生成查询条件
  471.         Card_Str = " where 1=1 "
  472.         For Jsqte = 1 To 9
  473.             Select Case Jsqte
  474.                 Case 1      '卡片开始变动日期
  475.                     If Trim(.LrText(0).Text) <> "" Then
  476.                         Card_Str = Card_Str & " And Gdzc_Variation.VariDate>=' " & Trim(.LrText(0).Text) & "'"
  477.                     End If
  478.                 Case 2      '卡片录入变动日期
  479.                     If Trim(.LrText(1).Text) <> "" Then
  480.                         Card_Str = Card_Str & " and Gdzc_Variation.VariDate<= '" & Trim(.LrText(1).Text) & "'"
  481.                     End If
  482.                 Case 3      '变动单号(开始)
  483.                     If Trim(.LrText(2).Text) <> "" Then
  484.                         Card_Str = Card_Str & " and Gdzc_Variation.VariVouCode>='" & Trim(.LrText(2).Text) & "'"
  485.                     End If
  486.                 Case 4      '变动单号(终止)
  487.                     If Trim(.LrText(3).Text) <> "" Then
  488.                         Card_Str = Card_Str & " and Gdzc_Variation.VariVouCode<='" & Trim(.LrText(3).Text) & "'"
  489.                     End If
  490.                 Case 5      '卡片编号(开始)
  491.                     If Trim(.LrText(4).Text) <> "" Then
  492.                         Card_Str = Card_Str & " and Gdzc_Variation.CardCode>='" & (Trim(.LrText(4).Text)) & "'"
  493.                     End If
  494.                 Case 6      '卡片编号(终止)
  495.                     If Trim(.LrText(5).Text) <> "" Then
  496.                         Card_Str = Card_Str & " and Gdzc_Variation.CardCode<='" & (Trim(.LrText(5).Text)) & "'"
  497.                     End If
  498.                 Case 7      '资产编号(开始)
  499.                     If Trim(.LrText(6).Text) <> "" Then
  500.                         Card_Str = Card_Str & " and Gdzc_Card.FACode>='" & (Trim(.LrText(6).Text)) & "'"
  501.                     End If
  502.                 Case 8      '资产编号(终止)
  503.                     If Trim(.LrText(7).Text) <> "" Then
  504.                         Card_Str = Card_Str & " and Gdzc_Card.FACode<='" & (Trim(.LrText(7).Text)) & "'"
  505.                     End If
  506.                 Case 9      '变动方式
  507.                     If Trim(.LrText(8).Text) <> "" Then
  508.                         Card_Str = Card_Str & " and Gdzc_Variation.FAVariCode='" & Trim(.LrText(8).Tag) & "'"
  509.                     End If
  510.             End Select
  511.         Next Jsqte
  512.     End With
  513.  
  514.     Sqlstr = "SELECT Gdzc_Variation.VariVouCode,Gdzc_Variation.CardCode,Gdzc_Variation.VariDate, " _
  515.         & "Gdzc_Variation.VariationReason, Gdzc_Card.FAName, Gdzc_VariationMode.FAVariName, Gy_Department.DeptName, " _
  516.         & "Gdzc_State.FAStateName, Gdzc_Variation.DeprMethNew,Gdzc_Variation.FAQuantityNew, Gdzc_Variation.FAValueNew, " _
  517.         & "Gdzc_Variation.SumDeprNew, Gdzc_Variation.SalValueNew,Gdzc_Variation.UseYearsNew, Gdzc_Variation.ActivitiesNew, " _
  518.         & "Gdzc_Sort.FASortName FROM Gdzc_Variation LEFT OUTER JOIN Gdzc_Sort ON Gdzc_Variation.FASortNew = Gdzc_Sort.FASortCode LEFT OUTER JOIN " _
  519.         & "Gdzc_State ON Gdzc_Variation.FAStateNew = Gdzc_State.FaStateCode LEFT OUTER JOIN " _
  520.         & "Gy_Department ON Gdzc_Variation.DeptNew = Gy_Department.DeptCode LEFT OUTER JOIN " _
  521.         & "Gdzc_VariationMode ON Gdzc_Variation.FAVariCode = Gdzc_VariationMode.FAVariCode LEFT OUTER JOIN " _
  522.         & "Gdzc_Card ON Gdzc_Variation.CardCode = Gdzc_Card.CardCode "
  523.     
  524.     Sqlstr = Sqlstr & Trim(Card_Str) & " order by Gdzc_Variation.VariVouCode"
  525.     Set Rec_Query = Cw_DataEnvi.DataConnect.Execute(Sqlstr)
  526.     With Rec_Query
  527.     CxbbGrid.Rows = CxbbGrid.FixedRows
  528.     CxbbGrid.Rows = CxbbGrid.FixedRows + .RecordCount
  529.     Jsqte = CxbbGrid.FixedRows
  530.    
  531.     Do While Not .EOF
  532.         If Jsqte >= CxbbGrid.Rows Then
  533.             CxbbGrid.AddItem ""
  534.         End If
  535.         
  536.         CxbbGrid.TextMatrix(Jsqte, Sydz("001", GridStr(), Szzls)) = Trim(!VariVouCode & "")                     '变动单号
  537.         CxbbGrid.TextMatrix(Jsqte, Sydz("002", GridStr(), Szzls)) = Trim(!CardCode & "")                        '卡片编号
  538.         CxbbGrid.TextMatrix(Jsqte, Sydz("003", GridStr(), Szzls)) = Format(!varidate, "yyyy-mm-dd")             '变动日期
  539.         CxbbGrid.TextMatrix(Jsqte, Sydz("004", GridStr(), Szzls)) = Trim(!VariationReason & "")                 '资产变动原因
  540.         CxbbGrid.TextMatrix(Jsqte, Sydz("005", GridStr(), Szzls)) = Trim(!FAName & "")                          '资产名称
  541.         CxbbGrid.TextMatrix(Jsqte, Sydz("006", GridStr(), Szzls)) = Trim(!FAVariName & "")                      '变动方式
  542.         CxbbGrid.TextMatrix(Jsqte, Sydz("007", GridStr(), Szzls)) = Trim(!DeptName & "")                        '部门编号
  543.         CxbbGrid.TextMatrix(Jsqte, Sydz("008", GridStr(), Szzls)) = Trim(!FAStateName & "")                     '是用状况
  544.         Select Case !DeprMethNew                                                                                '折旧方法
  545.             Case "01"
  546.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "不计提折旧"
  547.             Case "02"
  548.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "平均年限法(依净资产计提折旧)"
  549.             Case "03"
  550.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "平均年限法(依帐面原值计提折旧)"
  551.             Case "04"
  552.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "工作量法"
  553.             Case "05"
  554.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "固定折旧额折旧法"
  555.             Case "06"
  556.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "年数总和法"
  557.             Case "07"
  558.                 CxbbGrid.TextMatrix(Jsqte, Sydz("009", GridStr(), Szzls)) = "双倍余额法"
  559.         End Select
  560.         CxbbGrid.TextMatrix(Jsqte, Sydz("010", GridStr(), Szzls)) = Trim(!FASortName & "")                      '资产类别
  561.         CxbbGrid.TextMatrix(Jsqte, Sydz("011", GridStr(), Szzls)) = Trim(!FAQuantityNew & "")                   '资产数量
  562.         CxbbGrid.TextMatrix(Jsqte, Sydz("012", GridStr(), Szzls)) = Trim(!FAValueNew & "")                      '资产原值
  563.         CxbbGrid.TextMatrix(Jsqte, Sydz("013", GridStr(), Szzls)) = Trim(!SumDeprNew & "")                      '累计折旧
  564.         CxbbGrid.TextMatrix(Jsqte, Sydz("014", GridStr(), Szzls)) = Trim(!SalValueNew & "")                     '净残值
  565.         CxbbGrid.TextMatrix(Jsqte, Sydz("015", GridStr(), Szzls)) = Trim(!UseYearsNew & "")                     '使用年限
  566.         CxbbGrid.TextMatrix(Jsqte, Sydz("016", GridStr(), Szzls)) = Trim(!ActivitiesNew & "")                   '工作总量
  567.         CxbbGrid.RowHeight(Jsqte) = Sjhgd
  568.         .MoveNext
  569.         Jsqte = Jsqte + 1
  570.     Loop
  571.     End With
  572.     '为零时清空单元格
  573.     Call Txt_Clear
  574.     
  575. End Sub
  576. Private Sub bbyl(bbylte As Boolean)                    '报表打印预览
  577.     
  578.     Dim Bbzbt$, Bbxbt() As String, bbxbtzzxs() As Integer, Bbxbtgs As Integer
  579.     Dim Bbbwh() As String, Bbbwhzzxs() As Integer, Bbbwhgs As Integer
  580.     Bbxbtgs = 1                                          '报 表 小 标 题 行 数
  581.     Bbbwhgs = 0                                          '报 表 表 尾 行 数
  582.     ReDim Bbxbt(1 To Bbxbtgs)
  583.     ReDim bbxbtzzxs(1 To Bbxbtgs)
  584.     
  585.     If Bbbwhgs <> 0 Then
  586.         ReDim Bbbwh(1 To Bbbwhgs)
  587.         ReDim Bbbwhzzxs(1 To Bbbwhgs)
  588.     End If
  589.     
  590.     Bbzbt = ReportTitle
  591.     Bbxbt(1) = " "
  592.     bbxbtzzxs(1) = 0                                     '报表行组织形式(0-居左 1-居中 2-居右)
  593.     
  594.     Call Scyxsjb(CxbbGrid)                               '生成报表数据
  595.     Call Scdybb(Dyymctbl, Bbzbt, Bbxbt(), bbxbtzzxs(), Bbxbtgs, Bbbwh(), Bbbwhzzxs(), Bbbwhgs, bbylte)
  596.   
  597.     If Not bbylte Then
  598.         Unload DY_Tybbyldy
  599.     End If
  600. End Sub
  601. '********************************************************************************
  602. '[>>以下为自定义函数
  603. '为零时清空单元格
  604. Function Txt_Clear()
  605.     Dim Row_Integer, Col_Integer As Integer         '行数和列数变量
  606.     
  607.     For Row_Integer = CxbbGrid.FixedRows To CxbbGrid.Rows - 1
  608.         For Col_Integer = 10 To CxbbGrid.Cols - 1
  609.             If Val(CxbbGrid.TextMatrix(Row_Integer, Col_Integer)) = 0 Then
  610.                 CxbbGrid.TextMatrix(Row_Integer, Col_Integer) = ""
  611.             End If
  612.         Next Col_Integer
  613.     Next Row_Integer
  614.     
  615. End Function
  616. '<<]
  617. '****************************************************