以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何将报表指定列设置成日期型 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=145379) |
-- 作者:季朝龙 -- 发布时间:2020/1/17 17:00:00 -- 如何将报表指定列设置成日期型 狐狸爸爸,帮忙看看如何将报表指定列设置成日期型,代码该如何写呀 Dim dt As Table = Tables("齐套异常") Dim Book As New XLS.Book \'定义一个Excel工作簿 Dim Sheet As XLS.Sheet = Book.Sheets(0) \'引用工作簿的第一个工作表 Sheet.Cols(0).Width = 120 Sheet.Cols(1).Width = 200 Sheet.Cols(2).Width = 120 Sheet.Cols(3).Width = 120 Sheet.Cols(4).Width = 200 Sheet.Cols(5).Width = 300 Sheet.Cols(6).Width = 300 Sheet.Cols(7).Width = 120 Dim Style2 As Xls.Style = Book.NewStyle \'新建一个样式 Style2. = Format(#12/31/2008#, "yyyy-MM-dd") Sheet.Cols(2).Style = Style2. Dim Style As Xls.Style = Book.NewStyle \'新建一个样式 Style.AlignHorz = XLS.AlignHorzEnum.Center Style.AlignVert = XLS.AlignVertEnum.Center Style.BackColor = Color.Cyan Style.ForeColor = Color.Red Style.BorderTop = XLS.LineStyleEnum.Thin Style.BorderBottom = XLS.LineStyleEnum.Thin Style.BorderLeft = XLS.LineStyleEnum.Thin Style.BorderRight = XLS.LineStyleEnum.Thin Style.BorderColorTop = Color.Black Style.BorderColorBottom = Color.Black Style.BorderColorLeft = Color.Black Style.BorderColorRight = Color.Black Style.WordWrap = True Dim fnt As New Font("宋体",14,FontStyle.Bold) Style.Font = fnt |
-- 作者:有点蓝 -- 发布时间:2020/1/17 17:16:00 -- Style2.Format = "yyyy-MM-dd" Sheet.Cols(2).Style = Style2
|