private void ShowPreviewWithUserControl(AbstractRenderer renderer, double zoomFaktor) { System.Drawing.Printing.PrintDocument doc = renderer.ReportDocument; //doc.PrintController = new ExtendedPrintController(new System.Drawing.Printing.PreviewPrintController()); // doc.Print(); printPreviewControl1.InvalidatePreview(); printPreviewControl1.Document = null; printPreviewControl1.Document = doc; printPreviewControl1.Zoom = zoomFaktor; printPreviewControl1.Document.DocumentName = renderer.ReportSettings.ReportName; printPreviewControl1.UseAntiAlias = true; }
/// <summary> /// Initialize the preview area with new document settings. /// </summary> private void resetPreviewArea() { // print the document again PrintDocument doc = Document; Document = null; Document = doc; // move to the first page PreviewArea.StartPage = 0; PageRange.Text = (PreviewArea.StartPage + 1).ToString(); PreviewArea.InvalidatePreview(); }
protected override void OnClosing(CancelEventArgs e) { print_preview.InvalidatePreview(); base.OnClosing(e); }