public void Print(FamilyMember person, IEnumerable <Occurrence> occurrences, OccurrenceAttendance attendance, ComputerSystem system) { // Don't new up Kiosk w/o empty constructor, might be too costly Kiosk kiosk = new Kiosk() { System = system }; var jobs = kiosk.GetPrintJobs(attendance); ReportPrinter printer = new ReportPrinter(); foreach (ReportPrintJob job in jobs) { printer.PrintReport(job.PrinterName, job.ReportPath, job.Copies, job.Landscape, job.Parameters, job.PrinterName); } }
public void Print(FamilyMember person, IEnumerable <Occurrence> occurrences, OccurrenceAttendance attendance, ComputerSystem system) { // Don't new up Kiosk w/o empty constructor, might be too costly Kiosk kiosk = new Kiosk() { System = system }; var jobs = kiosk.GetPrintJobs(attendance); ReportPrinter printer = new ReportPrinter(); // Work around a bug in the way the ReportPrinter.PrintReports(jobs) method works... // ...it uses impersonation which seems to cause some problems with printing on Win 2008 R2 SP1. foreach (ReportPrintJob job in jobs) { printer.PrintReport(job.PrinterName, job.ReportPath, job.Copies, job.Landscape, job.Parameters, job.PrinterName); } }