1、你说的是报表?excel报表?你excel模板发上来看看。
2、输入录入的时候,自动在收、发表添加添加数据?
http://www.foxtable.com/webhelp/scr/2490.htm
3、编码问题
Select e.DataCol.Name
Case "代码","月"
If e.DataRow.IsNull("代码") OrElse e.DataRow.IsNull("月") Then
e.DataRow("单据编号") = Nothing
Else
Dim bh As String = e.DataRow("代码") & format( val(e.DataRow("月")), "00") & "-" '生成编号的前缀
If e.DataRow("单据编号").StartsWith(bh) = False '如果单据编号前缀不符
Dim max As String
Dim idx As Integer
Dim flt As String
flt = "代码 = '"& e.DataRow("代码") & "' and 月 = '"& e.DataRow("月") & "'"
max = e.DataTable.Compute("Max(单据编号)",flt) '取得该月的相同工程代码的最大单据编号
If max > "" Then '如果存在最大单据编号
idx = CInt(max.Substring(bh.length,3)) + 1 '获得最大单据编号的后三位顺序号,并加1
Else
idx = 1 '否则顺序号等于1
End If
e.DataRow("单据编号") = bh & Format(idx,"000")
End If
End If
End Select