Bypassing the Print Dialog in Crystal Report Viewer PrintReport method

Is there a way to not have the Print Dialog pop up when I print to printer (using PrintReport method) using the CR Report Viewer? I need the report to print to the default printer without user clicking the OK button. Is there some other way to print a Crystal reports without using the Report Viewer?

This is a windows applicaton developed in Visual Studio .net, VB.net.
fruffingAsked:
Who is Participating?
 
Computer101Connect With a Mentor Commented:
PAQed, with points refunded (400)

Computer101
E-E Admin
0
 
mlmccCommented:
Not sure about the PrintReport method (have no reference material here) but using th eRDC there is a parameter that when set false prints automatically

crRpt.PrintOut False

mlmcc
0
 
J_FullerCommented:
The viewer sends a printbuttonclicked event notification just override the default and print the report as you desire

C++ example

BEGIN_EVENTSINK_MAP(Dlg, CDialog)
      ON_EVENT(Dlg, IDC_CRVIEWER1, 409, PrintButtonClickedCrviewer1, VTS_PBOOL)
END_EVENTSINK_MAP()

void Dlg::PrintButtonClickedCrviewer1(BOOL* UseDefault)
{
      *UseDefault=FALSE;

      //Your print code here
}
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
ParsiCommented:
Hi fruffing

for your second question you can use
 Cr1.Destination = crptToPrinter
 Cr1.Action=1

this way you can print without viewing report.
0
 
mlmccCommented:
Parsi - that won't work with CR.Net since CR.Net doesn't support the OCX.

mlmcc
0
 
ndonhauserCommented:
Are you using the Crystal Reports Enterprise edition or just the one built into Visual Studio 2003?
0
 
fruffingAuthor Commented:
I was trying to use the one built into VS 2003. I have since put the OCX from CR8 onto the form and am using that. Works fine. Found that solution elsewhere on the net with a google search. thanks for the help, all.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.