Foxtable(狐表)用户栏目专家坐堂 → 月统计为何没出来呢?


  共有2927人关注过本帖树形打印复制链接

主题:月统计为何没出来呢?

美女呀,离线,留言给我吧!
lfz123
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:530 积分:4613 威望:0 精华:0 注册:2018/3/24 18:04:00
月统计为何没出来呢?  发帖心情 Post By:2020/9/18 9:07:00 [显示全部帖子]

月统计为何没出来呢?(见黄色代码)
以下是窗口的afterload 事件代码
Dim str As String = CurrentTable.Current("科目代码")
e.Form.Controls("Label9").text = str '科目代码
str = str.SubString(0,4)
Dim drr As DataRow = DataTables("会计科目").find("科目代码 = '"& str & "'")
If drr IsNot Nothing Then
    e.Form.Controls("Label8").text = drr("科目名称") & " - 明细账"
End If
'
Dim cn As Connection = Connections("shxy")
Dim s As String = cn.ConnectionString
Dim idx As Integer = s.IndexOf("Data Source=")
Dim idx2 As Integer = s.IndexOf(";",idx)
vars("y") = s.SubString(idx+12,idx2 - idx-12)
vars("y") = vars("y").SubString(vars("y").Length - 8)
vars("y") = vars("y").SubString(0,4)

e.Form.Controls("neme").text = Tables("公司信息").rows(0)("公司名称") 
e.Form.Controls("Label4").text = vars("y") 


Dim dr4 As DataRow = DataTables("会计科目").find("科目代码 = '" & CurrentTable.Current("科目代码") & "'")
If dr4 IsNot Nothing Then
    e.Form.Controls("tb科目代码").text = dr4("科目名称")
End If

DataTables("明细账查询").DataRows.Clear
Dim dr2 As DataRow = DataTables("会计科目").find("科目代码 = '" & CurrentTable.Current("科目代码") & "'")
If dr2 IsNot Nothing Then
    If dr2.IsNull("期初余额") = False  Then
        Dim dr3 As DataRow = DataTables("明细账查询").addnew
        dr3("日期") = New Date(vars("y"),01,01)
        dr3("摘要") = "期初余额"
        dr3("方向") = dr2("方向")
        dr3("余额") = dr2("期初余额")
    End If
End If
For Each dr As DataRow In DataTables("凭证明细").SQLSelect("科目代码 = '" & CurrentTable.Current("科目代码") & "'","","凭证ID")
    Dim dr1 As DataRow = DataTables("明细账查询").AddNew()
    dr1("日期") = dr("日期")
    dr1("凭证ID") = dr("凭证ID")
    dr1("摘要") = dr("摘要")
    dr1("借方") = dr("借方金额")
    dr1("贷方") = dr("贷方金额")
    dr1("方向") = dr2("方向")
Next

Dim t As Table = Tables("明细账查询")
t.OpenView("明细账查询")

T.Grid.Styles.EmptyArea.backcolor = color.white '设置表格内空白区域的背景色为 白色
T.Grid.Styles.EmptyArea.Border.Style = 0   '去表格边框

Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "日期"
g.TotalOn = "借方,贷方"
g.upto = True
t.SubtotalGroups.Add(g)
t.Subtotal()

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "日期"
g.TotalOn = "借方,贷方"
g.Caption = "{0}年 累计"
g.DateGroup = DateGroupEnum.Year
g.upto = True
t.SubtotalGroups.Add(g)
t.Subtotal()

 回到顶部