- 积分
- 17
- 在线时间
- 19 小时
- 主题
- 0
- 注册时间
- 2016-9-29
- 帖子
- 21
- 最后登录
- 2021-11-22
- 帖子
- 21
- 软币
- 241
- 在线时间
- 19 小时
- 注册时间
- 2016-9-29
|
发表于 2016-12-31 10:36:04
|
显示全部楼层
1. 构建style:
Dim App_exe_Dir As New IO.FileInfo(Reflection.Assembly.GetExecutingAssembly.FullName)
Dim xlPath_Template = IO.Path.Combine(App_exe_Dir.DirectoryName, "Resources\AL_Templates.xlsx")
CommonWorkBook = New Workbook(xlPath_Template)
HeadingStyle = CommonWorkBook.CreateStyle()
HeadingStyle.Pattern = BackgroundType.Solid
HeadingStyle.Borders.Item(BorderType.LeftBorder).LineStyle = CellBorderType.Hair
HeadingStyle.Borders.Item(BorderType.RightBorder).LineStyle = CellBorderType.Double
HeadingStyle.ForegroundColor = Color.FromArgb(192, 192, 192)
HeadingStyle.Font.IsBold = True
HeadingStyle.HorizontalAlignment = TextAlignmentType.Center
2. 应用 style(一次性的apply 到 cell range):
Dim SetHeadingRange As Aspose.Cells.Range = .Cells.CreateRange(CellRowIndex + 4 + ACBO, 11 + k + 3 + ACBO, 1, 13)
SetHeadingRange.Merge()
SetHeadingRange.SetStyle(HeadingStyle)
|
|