public void PrintGrid(object param) { try { PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == false) return; string documentTitle = "All Clients Billing Report"; Size pageSize = new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight); AllClientBillingReportPrinter paginator = new AllClientBillingReportPrinter(param as DataGrid, documentTitle, pageSize, new Thickness(30, 20, 30, 20)); printDialog.PrintDocument(paginator, "Grid"); Helper.ShowInformationMessageBox("All Clients Billing Report Exported.", "All Clients Billing Report"); } catch (Exception ex) { Helper.LogException(ex); } }
public void PrintGrid(object param) { try { PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == false) { return; } string documentTitle = "All Clients Billing Report"; Size pageSize = new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight); AllClientBillingReportPrinter paginator = new AllClientBillingReportPrinter(param as DataGrid, documentTitle, pageSize, new Thickness(30, 20, 30, 20)); printDialog.PrintDocument(paginator, "Grid"); Helper.ShowInformationMessageBox("All Clients Billing Report Exported.", "All Clients Billing Report"); } catch (Exception ex) { Helper.LogException(ex); } }