Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:如何用代码实现把交叉统计的临时表的内容复制到正式表中?

1楼
jiawei507 发表于:2024/3/23 14:46:00
如何用代码实现把交叉统计的临时表的内容复制到正式表中?尝试好久,整不明白,能帮忙写下吗?

Dim Cols1() As String = { "项目归属", "项目编号", "开piao"}
Dim Cols2() As String = { "项目归属", "项目编号", "开piao"}
 Each dr1 As DataRow In DataTables("统计表1").DataRows
 DataTables("产值统计表").DataRows.Clear
    Dim dr2 As DataRow = DataTables("产值统计表").AddNew()
    For i As Integer = 0 To Cols1.Length - 1
        dr2(Cols2(i)) = dr1(Cols1(i))
    Next
Next
图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20240323144310.png
图片点击可在新窗口打开查看

谢谢了
2楼
有点蓝 发表于:2024/3/23 15:10:00
DataTables("产值统计表").DataRows.Clear
For Each dr1 As DataRow In DataTables("统计表1").DataRows
    Dim dr2 As DataRow = DataTables("产值统计表").AddNew()
    For Each dc As DataCol In DataTables("统计表1").datacols
        If DataTables("产值统计表").datacols.contains(dc.caption) Then
            dr2(dc.caption) = dr1(dc.name)
        ElseIf DataTables("产值统计表").datacols.contains(dc.name) Then
            dr2(dc.name) = dr1(dc.name)
        End if
    Next
Next
3楼
jiawei507 发表于:2024/3/23 15:26:00
周末都这么给力,感谢大佬,辛苦了!
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02539 s, 2 queries.