Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
当报表模板中的日期列没有设置日期格式的时候:这段格式化日期的代码怎么不起作用???
Dim Book1 As New XLS.Book(ProjectPath & "Attachments\订单.xls")
Dim Sheet As XLS.Sheet = Book1.Sheets(0)
Dim St2 As XLS.Style = Book1.NewStyle() ‘这段格式化日期的代码怎么不起作用???
St2.Format = "yyyy-MM-dd"
Sheet.Cols(tables("订单").Cols("日期").index).Style = st2
Book1.Build() '生成细节区
Book1.Save(ProjectPath & "reports\订单.xls")
Dim Proc As New Process '打开工作簿
Proc.File = ProjectPath & "reports\订单.xls"
Proc.Start()
这样也行
Dim Book1 As New XLS.Book(ProjectPath & "Attachments\订单.xls")
Dim Sheet As XLS.Sheet = Book1.Sheets(0)
Dim St2 As XLS.Style = Book1.NewStyle() '这段格式化日期的代码怎么不起作用???
St2.BorderTop = XLS.LineStyleEnum.Thin
St2.BorderBottom = XLS.LineStyleEnum.Thin
St2.BorderLeft = XLS.LineStyleEnum.Thin
St2.BorderRight = XLS.LineStyleEnum.Thin
St2.Format = "yyyy-MM-dd"
Sheet(3,tables("订单").cols.Count).Style = St2
Book1.Build() '生成细节区
Book1.Save(ProjectPath & "reports\订单.xls")
Dim Proc As New Process '打开工作簿
Proc.File = ProjectPath & "reports\订单.xls"
Proc.Start()
光这样改还不够,新的样式会删除原有的样式,所以还得重新设置边框