Click here to Skip to main content
14,693,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how do you print a report directly without using a crystal report view.(without preview the report before printing)
I am using crystal report with ado.net.
any help !!!1
Posted
Comments
thatraja 4-May-11 10:33am
   
Hi, You can achieve the same thing by my answer(I mean I gave you web solution because you didn't mention about your application is windows or web....... But you can use the coding from the answer(The PrintToPrinter method)). Anyway I have updated my answer. Please check.

Here you go

Automatically Printing Crystal Reports in ASP.NET[^]

It contains two ways both server & client side.

EDIT
---------------------------------------
Use ReportDocument.PrintToPrinter Method[^] that's all.
   
v2
Comments
Sandeep Mewara 4-May-11 4:36am
   
Comment from OP:
plz i want to print directly the crystal report using command button in vb.net(i have developed an invoice form for that,i need to take printout for every transaction as a receipt without preview it)
thatraja 5-May-11 0:24am
   
Replied him Sandeep, Also updated my answer but the OP couldn't extract the piece from the first link :Doh:
Sandeep Mewara 5-May-11 1:01am
   
I agree. Countered your 1 vote.
i use iis7 with asp.net 2005
on win server 2008 r2 64bit
and my printer it is network printer
and use server side to print
this code work correct from visual studio but when publish application and make print from url i get this error:
.Invalid printer specified.><><>< at CrystalDecisions.ReportAppServer.Controllers.PrintOutputControllerClass.ModifyPrinterName(String newVal).. at CrystalDecisions.CrystalReports.Engine.PrintOptions.set_PrinterName(String value).. at VisitRegister.PrintDirectlyFromServer(String idIndex)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900