以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助] 修改报表字体 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=100491) |
-- 作者:明天的灵 -- 发布时间:2017/5/12 11:29:00 -- [求助] 修改报表字体 项目事件 本人在报表事件中写了针对"保护"列为”√“的处理代码,符合条件,字体为红色。 现需要把符合条件的整行字体设置为”10“,请问如何修改。 AfterBuild Select Case e.Book.TempLate Case "信息表" Dim Sheet As XLS.Sheet = e.Book.Sheets(0) For i As Integer = 2 To sheet.Rows.Count - 1 If sheet(i, 3).text ="√" Then For j As Integer = 0 To 3 Dim Style As Xls.Style = e.Book.NewStyle style.ForeColor = Color.Red style.AlignHorz = sheet(i,j).Style.AlignHorz style.BorderBottom = sheet(i,j).Style.BorderBottom style.BorderColorBottom = sheet(i,j).style.BorderColorBottom style.BorderColorRight = sheet(i,j).Style.BorderColorRight style.BorderRight = sheet(i,j).Style.BorderRight sheet(i,j).Style = style Next End If Next End Select |
-- 作者:有点色 -- 发布时间:2017/5/12 11:45:00 -- Select Case e.Book.TempLate Case "信息表" Dim Sheet As XLS.Sheet = e.Book.Sheets(0) For i As Integer = 2 To sheet.Rows.Count - 1 If sheet(i, 3).text ="√" Then For j As Integer = 0 To 3 Dim Style As Xls.Style = e.Book.NewStyle style.ForeColor = Color.Red style.Font = new Font("宋体", 10) style.AlignHorz = sheet(i,j).Style.AlignHorz style.BorderBottom = sheet(i,j).Style.BorderBottom style.BorderColorBottom = sheet(i,j).style.BorderColorBottom style.BorderColorRight = sheet(i,j).Style.BorderColorRight style.BorderRight = sheet(i,j).Style.BorderRight style.BorderColorleft = sheet(i,j).Style.BorderColorleft style.Borderleft = sheet(i,j).Style.Borderleft sheet(i,j).Style = style Next End If Next End Select |
-- 作者:明天的灵 -- 发布时间:2017/5/12 12:08:00 -- 可以了,谢谢 |