我正在使用VB.net和Winforms reportviewer来显示使用SQL Server Reporting Service生成的报告。 我想从后面的代码触发reportviewer的打印。请帮我做同样的事。
Dim usern = WindowsIdentity.GetCurrent().Name.ToString()
rptViewer.ProcessingMode = ProcessingMode.Remote
rptViewer.ServerReport.ReportServerUrl = New Uri("http://myserver/Reportserver")
rptViewer.ServerReport.ReportPath = "/Management Reports/InvoicReport"
Dim parm As ReportParameter
parm = New ReportParameter("parInvoiceID", InvoiceID)
rptViewer.ServerReport.SetParameters(parm)
rptViewer.ServerReport.Refresh()
Me.rptViewer.RefreshReport()
提前致谢
答案 0 :(得分:1)
在rptViewer的RenderingComplete事件上写下代码
rptViewer.PrintDialog()