// Get the PageMargins structure and set the
// margins for the report.
ReportDocument Report = new ReportDocument();
string path = Server.MapPath("企业登记基本情况_分年统计.rpt");
Report.Load(path);
margins = Report.PrintOptions.PageMargins;
margins.bottomMargin = 250;
margins.leftMargin = 350;
margins.rightMargin = 350;
margins.topMargin = 350;
// Apply the page margins.
Report.PrintOptions.ApplyPageMargins(margins);
// Select the printer.
string printerName = "打印机名";
Report.PrintOptions.PrinterName = printerName;
// Print the report. Set the startPageN and endPageN
// parameters to 0 to print all pages.
Report.SetDataSource(ds);
Report.PrintToPrinter(1, false,0,0);