private RadPrintDocument CreatePrintDocument() { RadPrintDocument doc = new RadPrintDocument(); doc.AssociatedObject = this; return(doc); }
public void Print() { RadPrintDocument doc = this.CreatePrintDocument(); doc.DefaultPageSettings.Landscape = true; doc.Print(); }
public static void PrintPreview(RadGridView grdData) { if (grdData.Rows.Count <= 0) { MessageBox.Show(@"No Datas To Be Printed.", @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } try { var rpd = new RadPrintDocument { Margins = new Margins(10, 10, 10, 10), DefaultPageSettings = { PaperSize = new PaperSize("A4", 850, 1100) }, AssociatedObject = grdData }; var dialog = new RadPrintPreviewDialog { ThemeName = grdData.ThemeName, Document = rpd, StartPosition = FormStartPosition.CenterScreen }; dialog.ShowDialog(); } catch (Exception e) { MessageBox.Show(@"Error While Printing Document." + Environment.NewLine + e.Message, @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args) { Bitmap bmp = new Bitmap(this.Width, this.Height); this.DrawToBitmap(bmp, new Rectangle(Point.Empty, this.Size)); args.Graphics.DrawImage(bmp, Point.Empty); return(false); }
public void PrintPreview() { RadPrintDocument doc = this.CreatePrintDocument(); doc.DefaultPageSettings.Landscape = true; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(doc); dialog.ThemeName = this.ThemeName; dialog.ShowDialog(); }
public Form1() { InitializeComponent(); this.radPivotGrid1 = new RadPivotGrid(); this.radPivotGrid1.ColumnWidth = 110; this.radPivotGrid1.Dock = DockStyle.Fill; this.radPrintDocument1 = new RadPrintDocument(); this.radPrintDocument1.AssociatedObject = this.radPivotGrid1; this.Controls.Add(this.radPivotGrid1); }
private void btnPrint_Click(object sender, EventArgs e) { RadPrintDocument document = new RadPrintDocument(); document.DefaultPageSettings.Landscape = true; document.HeaderHeight = 60; document.HeaderFont = new Font("Arial", 10, FontStyle.Bold); document.MiddleHeader = "Dansalan College Foundation, Inc. \r\n Marinaut, Marawi City, Lanao del Sur"; document.MiddleFooter = "Page [Page #] of [Total Pages]"; document.AssociatedObject = this.gridView; radPrintDocument1 = document; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = this.radPrintDocument1; dialog.ShowDialog(); }
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args) { float scale = Math.Min((float)args.MarginBounds.Width / panel.Size.Width, (float)args.MarginBounds.Height / panel.Size.Height); Bitmap panelBmp = new Bitmap(this.panel.Width, this.panel.Height); this.panel.DrawToBitmap(panelBmp, this.panel.Bounds); Matrix saveMatrix = args.Graphics.Transform; args.Graphics.ScaleTransform(scale, scale); args.Graphics.DrawImage(panelBmp, args.MarginBounds.Location); args.Graphics.Transform = saveMatrix; return(false); }
private void btnPrint_Click(object sender, EventArgs e) { RadPrintDocument document = new RadPrintDocument(); document.DefaultPageSettings.Landscape = true; document.HeaderHeight = 60; document.HeaderFont = new Font("Arial", 10, FontStyle.Bold); document.MiddleHeader = "Dansalan College Foundation, Inc. \r\n Marinaut, Marawi City, Lanao del Sur"; document.MiddleFooter = "Page [Page #] of [Total Pages]"; document.AssociatedObject = this.gvGradeSection; radPrintDocument1 = document; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = this.radPrintDocument1; dialog.ShowDialog(); }
private void menuPrintBirthdates_Click(object sender, EventArgs e) { printDocumentRad = new RadPrintDocument(); printDocumentRad.DefaultPageSettings.Landscape = false; printDocumentRad.AssociatedObject = this.gridViewEmployees; printDocumentRad.MiddleHeader = "Список дней рождения сотрудников офиса Фастдев, Екатеринбург"; printDocumentRad.HeaderFont = new System.Drawing.Font(FontFamily.GenericSerif, 15.0F); printDocumentRad.LeftFooter = "Число сотрудников: " + employeeManager.NumberOfEmployees(); ShowColumns(false, false); RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(); dialog.Document = printDocumentRad; dialog.ShowDialog(); ShowColumns(true, false); gridViewEmployees.BestFitColumns(BestFitColumnMode.DisplayedCells); }
private void PrintPreview_Click(object sender, RoutedEventArgs e) { RadPrintDocument document = new RadPrintDocument(); document.HeaderHeight = 30; document.HeaderFont = new Font("Arial", 22); document.Logo = System.Drawing.Image.FromFile(@"C:\MyLogo.png"); document.LeftHeader = "[Logo]"; document.MiddleHeader = "Middle header"; document.RightHeader = "Right header"; document.ReverseHeaderOnEvenPages = true; document.FooterHeight = 30; document.FooterFont = new Font("Arial", 22); document.LeftFooter = "Left footer"; document.MiddleFooter = "Middle footer"; document.RightFooter = "Right footer"; document.ReverseFooterOnEvenPages = true; document.AssociatedObject = this.radGridView1; RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document); dialog.Show(); gridView.PrintPreview(); }
private void PrintPane() { CalcPerGrading(); txtDate.Text = "Date: " + DateTime.Now.ToShortDateString(); txtDate.Visible = true; radPanel2.Size = new Size(702, 586); this.Size = new Size(710, 657); RadPrintDocument document = new RadPrintDocument(); document.AssociatedObject = new PanelPrinter(this.radPanel2); RadPrintPreviewDialog dialog = new RadPrintPreviewDialog(document); dialog.ShowDialog(); txtDate.Visible = false; radPanel2.Size = new Size(702, 361); this.Size = new Size(702, 316); }
public int BeginPrint(RadPrintDocument sender, PrintEventArgs args) { return(1); }
public Form GetSettingsDialog(RadPrintDocument document) { return null; }
public bool PrintPage(int pageNumber, RadPrintDocument sender, PrintPageEventArgs args) { float scale = Math.Min((float)args.MarginBounds.Width / panel.Size.Width, (float)args.MarginBounds.Height / panel.Size.Height); Bitmap panelBmp = new Bitmap(this.panel.Width, this.panel.Height); this.panel.DrawToBitmap(panelBmp, this.panel.Bounds); Matrix saveMatrix = args.Graphics.Transform; args.Graphics.ScaleTransform(scale, scale); args.Graphics.DrawImage(panelBmp, args.MarginBounds.Location); args.Graphics.Transform = saveMatrix; return false; }
public bool EndPrint(RadPrintDocument sender, PrintEventArgs args) { return true; }
public int BeginPrint(RadPrintDocument sender, PrintEventArgs args) { return 1; }
public bool EndPrint(RadPrintDocument sender, PrintEventArgs args) { return(true); }
public Form GetSettingsDialog(RadPrintDocument document) { return(null); }