求助vb.net下spreed的相关问题,恳请各位大虾指教。
以前用vb6做的一个程序升级到了vb.net,其中有两个spread。两个sprPrint一起打印。
在打印spread之前的一段:
……
.ActiveSheet.PrintInfo.Preview = True
For lngRow = 1 To .ActiveSheet.RowCount
.ActiveSheet.Rows(lngRow - 1).Visible = True
strText = Trim(.ActiveSheet.Cells(lngRow - 1, pcHColPrt - 1).Text)
.BorderCollapse = FarPoint.Win.Spread.BorderCollapse.Collapse
.ActiveSheet.Cells(lngRow - 1, pcColNo - 1, lngRow - 1, pcHColPrt - 1).Border = New FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.White, Color.White, 1, 0, 0, 0, 0)
Next lngRow
For lngCol = pcColNo To pcHColPrt
Next lngCol
.ActiveSheet.PrintInfo.ShowBorder = True
.ActiveSheet.PrintInfo.ShowColumnHeaders = True
End With
……
如果把的.ActiveSheet.PrintInfo.Preview = True改成False,取消了预览打印,得到的效果与更改之前不一样。
表现为只打印出来了sprPrint0,而sprPrint1打印不出来了;同时打印出的网格也与设定的不一样。
小弟初来乍到,恳请各位大虾指点。如果有vb.net下spread打印的相关sample,也可以指导一下小弟,不胜感激。
[解决办法]
既然是那样~,开始的时候就不要取消预览打印
当要数据填充完,再取消预览打印,试试