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

handling print event in visual studio 2010

51 Views

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 vb.net 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.Load("
DataServer64\Avista\Isaac.rpt")

oCrReportDocument = New ReportDocument()

oCrReportDocument.Load(reportpath)

'Store Report Object

Session.Add("RptNum", oCrReportDocument)

'srvLoad.ReportSource = Session("RptNum")

srcUse.CacheDuration = 500

End If

If (Page.IsPostBack = True) Then

oCrReportDocument = Session("RptNum")

'srvLoad.RefreshReport()

End If