SSRS printing without showind Print Dialog

I provide SSRS data. I want to print it directly without showing it on the screen and without even showing a dialog with the printer. I can send it to the printer without being displayed on the screen, but it displays the Print dialog box. How to avoid this?

thank

+1
source share
1 answer

Use threading here. After the print command is given, just start the stream, which will simulate the keystroke required to close the window.

Here is an example of code that closes a dialog box that requires you to press enter.

Start the stream after printing starts:

'Declare a thread object to do the keyboard press events.
 Dim thrd as Thread

    thrd = New Thread(AddressOf ThreadTask)
    thrd.IsBackground = True
    thrd.Start()

, , , . escape-, .

Private Sub ThreadTask()
    Thread.Sleep(100)
    SendKeys.SendWait("{TAB}")
    Thread.Sleep(10)
    SendKeys.SendWait("{ENTER}")
End Sub
0

All Articles