The PrintToPrinter method takes four parameters.
nCopies : Indicates the number of copies to print.
collated : Indicates whether to collate the pages.
startPageN : Indicates the first page to print.
endPageN : Indicates the last page to print.
The following steps will guide you to achieve the same:
Add crystal report (.cr) file to your ASP.NET application.
Add a report instance on the page level.
Dim report As MyReport = New MyReport
Populate reports data on Page_Init
' Get data in a DataSet or DataTable
Dim ds As DataSet = GetData()
' Fill report with the data
report.SetDataSource(ds)
Print Report
report.PrintToPrinter(1, False, 0, 0)
If you wish to print certain page range, change last two parameters From to To page number.
If you want to set page margins, you need to create a PageMargin object and set PrintOptions of the ReportDocument.
The following code sets page margins and printer name:
Dim margins As PageMargins = Report.PrintOptions.PageMargins
margins.bottomMargin = 200
margins.leftMargin = 200
margins.rightMargin = 50
margins.topMargin = 100
Report.PrintOptions.ApplyPageMargins(margins)
' Select the printer name
Report.PrintOptions.PrinterName = printerName
refer
http://www.c-sharpcorner.com/UploadFile/mahesh/CRPrinting10062006161454PM/CRPrinting.aspx
http://stackoverflow.com/questions/749455/printing-crystalreport-reports-in-a-asp-net-application-without-using-pdf