Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am trying to print local SSRS report through Winforms using following code.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.tblGoodsInTableAdapter.Fill(Me.dbPOsDataSet.tblGoodsIn)
    Me.ReportViewer1.RefreshReport()
End Sub
Private Sub ThreadTask()
    Thread.Sleep(100)
    SendKeys.SendWait("{TAB}")
    Thread.Sleep(10)
    SendKeys.SendWait("{ENTER}")
End Sub

Private Sub ReportViewer1_RenderingComplete(ByVal sender As Object, ByVal e As Microsoft.Reporting.WinForms.RenderingCompleteEventArgs) Handles ReportViewer1.RenderingComplete
    ReportViewer1.PrintDialog()
    Dim thrd As Thread
    thrd = New Thread(AddressOf ThreadTask)
    thrd.IsBackground = True
    thrd.Start()
End Sub


It works fine till viewing the print Dialogue box.
I need to hit the Print button of Print dialogue box programatically, so printing is done without user intervention. Please advise how to achieve this objective.

Thanks
Posted
Comments
db7uk 4-Aug-14 6:00am    
Hi,

Your code does not look right. Have you looked at the following link?

http://printssrsreport.blogspot.co.uk/2011/09/print-ssrs-report-using.html[^]

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900