Skip to Content
Former Member
Dec 21, 2011 at 07:56 PM

handling print event in visual studio 2010


I'm having problems controlling printer on the server.

getting error error on printer etc...

Is their an event on the report viewer print button that I can get to and provide

code in to attempt to control printing.

I've tried it all caching, sessions, etc...

Nothing has worked to prevent these annoying errors.

Below is a code snippet that renders pages but does not

guarantee printing of any number of pages.

It's happening within the app on the initial print attempt

and intermittently for large or small reports

If (Page.IsPostBack = False) Then

'Preload Assemblies


oCrReportDocument = New ReportDocument()


'Store Report Object

Session.Add("RptNum", oCrReportDocument)

'srvLoad.ReportSource = Session("RptNum")

srcUse.CacheDuration = 500

End If

If (Page.IsPostBack = True) Then

oCrReportDocument = Session("RptNum")


End If