Dim Book As New XLS.Book '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
For i As Integer = 0 To 9 '向工作表的单元格中设置值
Sheet(i, 0).Value = (i + 1) * 10
Sheet(i, 1).Value = (i + 1) * 100
Sheet(i, 2).Value = (i + 1) * 1000
Next
Sheet(10,2).Value = New XLS.Picture(GetImage("c:\Foxtable.Ico"))
Book.Save("c:\reports\test.xls") '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = "c:\reports\test.xls"
Proc.Start()
请问:利用EXCEL模版生成报表时,下面这句的图片想单独生成一页要如何修改?
Sheet(10,2).Value = New XLS.Picture(GetImage("c:\Foxtable.Ico"))
[此贴子已经被作者于2024/3/25 8:06:07编辑过]
http://www.foxtable.com/webhelp/topics/1158.htm
Sheet.Rows(9).PageBreak = True
Sheet(10,2).Value = New XLS.Picture(GetImage("c:\Foxtable.Ico"))
Sheet.Rows(10).PageBreak = True
感谢!可是我加了横向自动缩放后,Sheet.Rows(9).PageBreak = True这句就不生效了
先强制换页,然后只对下一页的图片单独设置横向自动缩放。
With Sheet.PrintSetting
.AutoScale = True '自动缩放
.FitPagesAcross = 1 '横重邮方向缩为1页
End With