Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
有一Excel报表每一记录占一页,当记录数超过1370行时,报表不正常甚至导致主机报警死机。
不正常
此主题相关图片如下:2010-12-15 10-32-12.png
正常时预览此主题相关图片如下:2010-12-15 10-58-19.png
有什么解决方法?
With Tables("申请表")
.Select(0 ,0, .Rows.Count - 1, .Cols.Count - 1)
End With
If Forms("选项").Controls("ComboBox1").Value >"" Andalso Forms("选项").Controls("ComboBox2").Value >"" Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\登记表.xls") '打开模板
Book.Build() '生成细节区
Book.Save("d:\My Documents\Reports\登记表.xls") '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File ="d:\My Documents\Reports\登记表.xls"
Proc.Start()
End If
用Excel 2007看看
怎么用循环来打印或预览?
我想个笨办法,先判断行数,不会写代码
If Forms("选项").Controls("ComboBox1").Value >"" AndAlso Forms("选项").Controls("ComboBox2").Value >"" Then
If ("_Identify") < 1370 Then
With Tables("申请表")
.Select(0 ,0, .Rows.Count - 1, .Cols.Count - 1)
End With
Dim Book As New XLS.Book(ProjectPath & "Attachments\核实表.xls") '打开模板
Book.Build() '生成细节区
Book.Save("d:\My Documents\Reports\核实表.xls") '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File ="d:\My Documents\Reports\核实表.xls"
Proc.Start()
End If
Else
MessageBox.Show("手工选定行数","提示")
End If
呵呵,你根据错误提示,应该能够找出这句代码的问题的。
这次我不说,你自己找。
Tables("xxx").Select(i, 0, i + 1369, .cols.count -1) 红点没加上啊
加上也不行的
For i as integer = 0 to tables("xxx").Rows.Count -1 Step 1370 这个是要每隔1370行打印一行吗?
For i as integer = 0 to 3 先试一试这个吧。只打印四行的。。。