Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have Following Code
C#
frmPreviewReports Preview = new frmPreviewReports();   //This form contain report viewer   (line 1)
SalesInvoice SInvoice = new SalesInvoice();   //this is the report document (line2) 
Preview.RptViewer.ReportSource = SInvoice (line 3)

Preview.Show(); // this preview the report  (line 4)
Preview.RptViewer.PrintReport();  // this prompt the printing dialog  (line 5)

but I would like to send the report to direct print without prompt printing dialog.
I mean (replace a single line to line 4)

How to do this ?
Posted
Updated 28-Nov-12 22:35pm
v2
Comments
anushikaroshan 29-Nov-12 6:26am    
thank lot your help was very useful for me

1 solution

C#
CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();// this is the object of ReportDodument

    string repName = string.Empty;

    repName = CrystalReportSource1.ReportDocument.FileName;//put here your SalesInvoice with its Namespace.SalesInvoice

    report.Load(repName); 

    report.PrintToPrinter(1, false, 0, 0); 


It will send your report document direct to the printer without seeing it.

Hope it will help...
 
Share this answer
 

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