以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- Excel表中布尔型值如何拷贝到Foxtable表的对应列中? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=30901) |
||||
-- 作者:kylin -- 发布时间:2013/4/6 15:49:00 -- Excel表中布尔型值如何拷贝到Foxtable表的对应列中? 1、例子见以下压缩包,Excel源表包含其中
2、请教,如何改造代码,还是如何改Excel源表中相关数据,还是其他什么解决办法?谢谢各位先! |
||||
-- 作者:狐狸爸爸 -- 发布时间:2013/4/7 8:54:00 -- Dim dlg As New OpenFileDialog \'定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xls" \'设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then \'如果用户单击了确定按钮 Dim Book As New XLS.Book(dlg.FileName) Dim Sheet As XLS.Sheet = Book.Sheets(0) Dim nms() As String = {"销售金额","税额","应收款金额","出库类别"} Tables("表A").AddNew(Sheet.Rows.Count -1) For m As Integer = 0 To nms.Length - 1 For n As Integer = 1 To Sheet.Rows.Count -1 Dim r As Row = Tables("表A").Rows(n-1) If m = 3 Then If Sheet(n,m).Text = "True" OrElse Sheet(n,m).Text = "1" r(nms(m)) = True Else r(nms(m)) = False End If Else r(nms(m)) = Sheet(n,m).Value End If Next Next End If |
||||
-- 作者:kylin -- 发布时间:2013/4/7 17:15:00 -- 多谢老六! |