现在模板分组的情况下无法填充空行,只能用代码处理了,做个按钮,代码如下:
Dim Book As New XLS.Book(ProjectPath & "Attachments\GZFPB.xls")
Dim fl As String = ProjectPath & "Reports\GZFPB.xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.UsedRange
Dim count As Integer = 0
For i As Integer = 1 To rg.Rows.count
If ws.cells(i,1).Text Like "*班(组)*" Then
If count = 1 Then '每2组设置一个分页符
Ws.Rows(i+1).PageBreak = MSExcel.XlPageBreak.xlPageBreakManual
count = 0
Else
count = 1
End If
End If
Next
app.visible = True