此主题相关图片如下:qq截图20200.jpg


此主题相关图片如下:qq截图20200.jpg

老师,我这个筛选是 本年、本季度、本月、、、、,然后这个这个分区里的表,是本年、本季度、本月、重合在一起的,这个筛选查询已经弄好了,可是筛选出来后,打印就不对,表隐藏、显示 ,在 打印 这个代码里,不会弄了,请教了。
打印代码 ,我现在 Table5 就是本年的筛选,打印就出现了上面的画面
e.Form.Controls("Table4").Visible = False
e.Form.Controls("Table5").Visible = True
e.Form.Controls("Table6").Visible = False
e.Form.Controls("Table7").Visible = False
e.Form.Controls("Table8").Visible = False
e.Form.Controls("Table9").Visible = False
Dim pg As WinForm.SplitPanel = Forms("粮食入库").Controls("SplitContainer9").Panel2
Dim doc As PrintDoc = e.Form.GernatePrintDoc(pg)
For Each c As object In Doc.Body.Children
If Typeof c Is prt.RenderTable Then
Dim t As prt.RenderTable = c
t.Rows(0).Style.Font = new font("宋体", 10, fontstyle.bold)
t.Rows(t.Rows.count-1).Style.Font = new font("宋体", 10, fontstyle.bold)
For i As Integer = 0 To t.Rows.count-1
For j As Integer = 0 To t.Cols.count-1
t.cells(i,j).Style.BackColor = Color.white
t.cells(i,j).Style.TextColor = Color.black
Next
Next
End If
Next
doc.Preview()