cancel
Showing results for 
Search instead for 
Did you mean: 

handling print event in visual studio 2010

Former Member
0 Kudos
98

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Please specify

Version of Crystal Reports?

Version of Visual Studio?

Look for 'PrintToPrinter' method in [CR .NET SDK developer guide |http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm]and 'PrintOutputController' in [InProc RAS .NEt SDk|http://help.sap.com/businessobject/product_guides/boexir31/en/rassdk_net_dg_12_en.chm] Dev guide.

Also, search the forum for printing crystal report, you will find many useful threads, articles, wikis and blogs.

Hope this helps,

Bhushan.

Former Member
0 Kudos

CR 13 sp1

VS 2010 sp2

Reports populating app were orginally developed using CR 12

with no modifications.

I was asked were they verified if I unerstand verification

the answer is yes. Should the verifications be removed/unchecked?

I've implemented cache duration, session control relative to the viewer etc.

Even 1 page reports create the printer error

Isaac

Former Member
0 Kudos

Hi again,

The documents referenced do not open correcting.

Thanks

0 Kudos

Use CR for VS 2010 SP2 and rebuild your app and distribute.

What is the actual error youa re getting?

Don

former_member188030
Active Contributor
0 Kudos

Right cick on the .chm file, go to properties, click 'Unblock' , 'Apply' and 'ok'.

Also take a look at the CR.NET SDK sample applications [here.|http://www.sdn.sap.com/irj/boc/samples?rid=/library/uuid/5050d3d0-19dd-2d10-ffb2-ddcd30a3e655]

- Bhushan.

Former Member
0 Kudos

The exact error is error occurred on the server printing will be stopped.

The error occurs on small and large reports immediately after clicking print button

I intermittenly get commucations error

It seems I have no control once I click the print button

I had the CR12 report developer turn off verify (Did'nt test yet)

This is a app of a solution with 10 projects. Looking to see if

original code developer is grabbing control of printing

Dim oCrReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()

Dim srvLoad As New CrystalDecisions.Web.CrystalReportViewer

Dim srcUse As New CrystalReportSource

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", srvLoad)

'srvLoad.ReportSource = Session("RptNum")

srcUse.CacheDuration = 62000

End If

If (Page.IsPostBack = True) Then

srvLoad = Session("RptNum")

'srvLoad.RefreshReport()

srcUse.CacheDuration = 62000

End If

Former Member
0 Kudos

Thanks, I'll take a look.

The exact error is error occurred on the server printing will be stopped.

The error occurs on small and large reports immediately after clicking print button

I intermittenly get commucations error

It seems I have no control once I click the print button

I had the CR12 report developer turn off verify (Did'nt test yet)

This is a app of a solution with 10 projects. Looking to see if

original code developer is grabbing control of printing

Dim oCrReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()

Dim srvLoad As New CrystalDecisions.Web.CrystalReportViewer

Dim srcUse As New CrystalReportSource

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", srvLoad)

'srvLoad.ReportSource = Session("RptNum")

srcUse.CacheDuration = 62000

End If

If (Page.IsPostBack = True) Then

srvLoad = Session("RptNum")

'srvLoad.RefreshReport()

srcUse.CacheDuration = 62000

End If

former_member188030
Active Contributor
0 Kudos

Search for 'a communication error has occurred, printing will be stopped' in the top right search box.

It will return many useful wikis, notes, articles and threads.

Bhushan.

Answers (0)