This tutorial shows you how to print directly the Report without going through the Crystal Report Viewer in C#.NET Windows Forms Application.
To print crystal report directly to printer in c# windows application you can modify your code as the following.
public void PrintReport(string reportPath, string PrinterName)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc =
new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rptDoc.Load(reportPath);
rptDoc.PrintOptions.PaperOrientation = PaperOrientation.Portrait;
rptDoc.PrintOptions.PaperSize = PaperSize.PaperA4;
rptDoc.PrintOptions.PrinterName = PrinterName;
rptDoc.PrintToPrinter(1, false, 0, 0);
}
public void Print()
{
PrintReport(Application.StartupPath +"\\csharpcode.rpt","Your printer name");
}
The rptDoc.PrintToPrinter method prints the specified pages of the report to the selected printer with the help of the PrintOptions.PrinterName property.
You can also add a button into your winform, then you can print your report with the button instead of using the crystal report viewer.