Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Avoiding print dialog box in crystal report .net Post Reply Post New Topic
Author Message
naveenagg
Newbie
Newbie


Joined: 01 Jun 2007
Location: India
Online Status: Offline
Posts: 1
Quote naveenagg Replybullet Topic: Avoiding print dialog box in crystal report .net
    Posted: 01 Jun 2007 at 6:28am
I m writing an application which requires a report to go directly the printer. I used crystalreportviewer and  its printreport() method to send it to printer but it always opens up print dialog. Is there any way to avoid/bypass print dialog? I read about printtoprinter method but its not available with report viewer.

Thanks in advance!
IP IP Logged
tehhz
Newbie
Newbie


Joined: 29 May 2007
Location: Singapore
Online Status: Offline
Posts: 3
Quote tehhz Replybullet Posted: 07 Jun 2007 at 7:00pm
Hi naveenagg,
 
You can use PrintToPrinter() method to directly print the Crystal Report to printer. Ensure that you have a printer that is configured as the default printer.
 
Assuming that you declared a ReportDocument variable as rptDoc.
 
rptDoc.PrintToPrinter(1, False, 1, 1)
 
where:
1 - no of copies
False - no collate
1 - first page you want to print
1 - last page you want to print
 
You can change the values if you need to print more.
 
LOL
 
Regards,
tehhz
IP IP Logged
MRC IT
Newbie
Newbie


Joined: 03 Oct 2007
Online Status: Offline
Posts: 2
Quote MRC IT Replybullet Posted: 05 Oct 2007 at 5:55am
Is there anyway to do this in Crystal XI?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 05 Oct 2007 at 10:01am
Are you ONLY using CR XI? Then no, CR XI is like any app where it prompts you for which printer you want to use. 
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.