以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 合并数据时,日期时间部分获取不完整 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=79479) |
-- 作者:农村人 -- 发布时间:2016/1/2 16:35:00 -- 合并数据时,日期时间部分获取不完整 Dim dlg As new OpenFileDialog dlg.Filter = "excle|*.xls" If dlg.ShowDialog = DialogResult.OK Then Dim Book As New XLS.Book(dlg.FileName) Dim Sheet As XLS.Sheet = Book.Sheets(0) Tables("考勤数据").StopRedraw() Dim nms() As String = {"部门","姓名","考勤号码","日期时间","机器号","编号","比对方式","卡号"} For n As Integer = 1 To Sheet.Rows.Count -1 Dim r As Row = Tables("考勤数据").AddNew() For m As Integer = 0 To nms.Length - 1 r(nms(m)) = Sheet(n,m).Value Next Next Tables("考勤数据").ResumeRedraw() End If 日期时间列只获得年月日,而时间部分却无法获取,请问如何解决
|
-- 作者:有点酸 -- 发布时间:2016/1/3 9:07:00 -- 其实是已经获取了的,只是默认不显示时间,只显示日期,你要设置一下列属性: http://www.foxtable.com/help/topics/0043.htm http://www.foxtable.com/help/topics/0044.htm
|
-- 作者:农村人 -- 发布时间:2016/1/3 10:22:00 -- 谢谢你的帮助; 我使用的代码如下: Dim dlg As new OpenFileDialog dlg.Filter = "excle|*.xls" If dlg.ShowDialog = DialogResult.OK Then Dim Book As New XLS.Book(dlg.FileName) Dim Sheet As XLS.Sheet = Book.Sheets(0) Tables("考勤数据").StopRedraw() Dim nms() As String = {"部门","姓名","考勤号码","日期时间","机器号","编号","比对方式","卡号"} For n As Integer = 1 To Sheet.Rows.Count -1 Dim r As Row = Tables("考勤数据").AddNew() For m As Integer = 0 To nms.Length - 1 r(nms(m)) = Sheet(n,m).Value Next Next Tables("考勤数据").ResumeRedraw() End If 尽管日期时间列我设置成日期类型,并且在类属性中,分别两次设置了日期格式DateTime和DateLongTime,最终均显示成: 2015/11/19 0:00:00 2015/11/20 0:00:00 2015/11/20 0:00:00 请问我这是哪里出问题了
|
-- 作者:大红袍 -- 发布时间:2016/1/3 22:13:00 -- xls.book 是有这样的问题。要用vba处理一下
http://foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=65686&skin=0
|