public void printCommand(object obj) { PRReportView PAFMReportView = new PRReportView(); PrintDialog pd = new PrintDialog(); if (pd.ShowDialog() != true) { return; } PAFMReportView.PRRFlowDocument.PageHeight = pd.PrintableAreaHeight; PAFMReportView.PRRFlowDocument.PageWidth = pd.PrintableAreaWidth; PAFMReportView.PRRFlowDocument.ColumnWidth = pd.PrintableAreaWidth; PAFMReportView.PRRFlowDocument.ColumnGap = 0; IDocumentPaginatorSource idocument = PAFMReportView.PRRFlowDocument as IDocumentPaginatorSource; pd.PrintDocument(idocument.DocumentPaginator, "Printing Flow Document..."); }
private void PRReport_Click(object sender, RoutedEventArgs e) { DataContext = new PRReportView(); }