以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  资产负债表,的生成,有什么好的办法?用专业报表要好些吗?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107736)

--  作者:yancheng
--  发布时间:2017/10/9 7:38:00
--  资产负债表,的生成,有什么好的办法?用专业报表要好些吗?
现在我用的如下代码:(感觉,以后改动,比较麻烦)


Dim tb As Table =Tables("资产负债表")
tb.DataTable.RejectChanges
Dim tb2 As Table = Tables("总分类账")
Dim qj As String = Vars("会计期间")
Dim n,n1,n2,n3,n4,n5,n6,n7 As Double
Dim lst,lst1,lst2,lst3 As List(of String)
\'计算期末数
\'                           0           1           2         3          4           5         6          7           8         9           10     11      12           13        14          15        16
Dim strs() As String = "{"货币资金","货币资金","应收票据","应收票据","应收账款","应收账款","预付款项","预付款项","其他应收款","其他应收款","库存","库存","工程施工","工程施工","工程结算","工程结算"}
Dim aa() As String = {"应收账款","预付款项"}
Dim aaa As New List(of String) 
aaa.AddRange(aa)
Dim strsx() As String = {" 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额"," 本 年 累 计"," 期 初 余 额" }
\'                     0   1   2   3   4   5   6   7   8   9   
Dim x() As String = {"1","1","3","3","4","4","5","5","8","8","9","9"}
Dim y() As String = {"6","7","6","7","6","7","6","7","6","7","6","7","6","7","6","7","6","7","6","7"}
Dim Ns As New List(Of Double)
\'会计科目中提取\'货币资金\'的科目代码
For i As Integer = 0 To strs.Length-1
    \' lst= DataTables("会计科目").GetValues("科目代码","资产负债表 like \'" & strs1(i) & "%\' or 资产负债表 like \'%" & strs1(i) & " \'")
    lst= DataTables("会计科目").GetValues("科目代码","资产负债表 = \'" & strs(i) & "\' or 资产负债表 like \'" & strs(i) &  "," & "%\' or 资产负债表 like \'%" & "," & strs(i) & "\'")
    If lst.Count > 0 Then
        Dim str As String
        For Each ids As String In lst
            str & =  ids & ","
        Next
        str = str.Trim(",")
       If  aaa.IndexOf(strs(i)) <> -1 Then
            n= tb2.DataTable.sqlCompute("sum(余额)","科目代码 in (" & str & ") And  摘要 = \'" & strsx(i) & "\' And 会计期间 = \'" & Vars("会计期间") & "\' ")
        Else
            n = tb2.DataTable.sqlCompute("sum(余额)","借或贷 = \'借\' And  科目代码 In (" & str & ") And  摘要 = \'" & strsx(i) & "\' and 会计期间 = \'" & Vars("会计期间") & "\' ")
        End If

        str = ""
        ns.Add(n)
    End If
Next
output.show(ns(1))
\'\'修正存货-(工程施工与工程结算的差额)
If ns(12) > ns(14) Then
output.show(ns(13))
ns(10) = ns(10) +(ns(12)- ns(14))
End If 


图片点击可在新窗口打开查看此主题相关图片如下:uc截图20171009073551.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2017/10/9 7:39:27编辑过]

--  作者:有点甜
--  发布时间:2017/10/9 8:34:00
--  

 做一个资产负债表模板,填入对应的值,然后根据这个表的数据去查找统计对应的数据,即可。

 

 不需要弄成专业报表,最后你生成的时候根据资产负债表对应生成你需要的格式,即可。