excel报表和foxtable报表里面都还可以,table里面却不能设置,只能在外部设置下数值,靠DrawCell绘制. 没办法如下面一样用代码指定style
Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
doc.Body.Children.Add(rt) '将表格对象加入到报表中
rt.Style.GridLines.All = New prt.Linedef(Color.DarkGray) '将表格的颜色设为深灰色
rt.Rows.Count = 3 '设置行数
rt.Cols.Count = 3 '设置列数
rt.Width = 150 '设置表格的宽度
rt.Height = 150 '设置表格的高度
rt.Rows(2).Style.Borders.All = New prt.LineDef("0.5mm", Color.Red)
rt.Cols(0).Style.Borders.All = New prt.LineDef("2mm", Color.Blue)
======
Dim Book As New XLS.Book() '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Dim Style As XLS.Style = Book.NewStyle() '定义新样式
Style.BorderTop = XLS.LineStyleEnum.Thin
Style.BorderBottom = XLS.LineStyleEnum.Thin
Style.BorderLeft = XLS.LineStyleEnum.Thin
Style.BorderRight = XLS.LineStyleEnum.Thin
Style.BorderColorTop = Color.Red
Style.BorderColorBottom = Color.Red
Style.BorderColorLeft = Color.Red
Style.BorderColorRight = Color.Red
For r As Integer = 1 to 5
For c As Integer =1 To 5
Sheet(r,c).Style = Style
Next
Next