private void btnPrint_Click(object sender, EventArgs e) { DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem(); DevExpress.XtraPrinting.PrintableComponentLink pcl = new DevExpress.XtraPrinting.PrintableComponentLink(ps); pcl.CreateReportHeaderArea += this.pcl_CreateReportHeaderArea; pcl.Component = gridIssues; pcl.Landscape = true; pcl.CreateDocument(); ps.PreviewFormEx.ShowDialog(); }
private void btnInDS_Click(object sender, EventArgs e) { DevExpress.XtraPrinting.PrintingSystem printingSystem1 = new DevExpress.XtraPrinting.PrintingSystem(); DevExpress.XtraPrinting.PrintableComponentLink printLink = new DevExpress.XtraPrinting.PrintableComponentLink(); try { //Set to landscape printingSystem1.PageSettings.Landscape = true; this.Cursor = Cursors.WaitCursor; printLink.Component = this.gridHoaDon; printLink.CreateDocument(printingSystem1); printingSystem1.PreviewRibbonFormEx.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { this.Cursor = Cursors.Default; printingSystem1.Dispose(); printLink.Dispose(); } }
private void PRINT1_OpenLink(object sender, DevExpress.XtraEditors.Controls.OpenLinkEventArgs e) { printableComponentLink1.CreateDocument(); printableComponentLink1.PrintingSystem.Print(); }
private void simpleButton1_Click(object sender, System.EventArgs e) { printableComponentLink1.CreateDocument(); printableComponentLink1.ShowPreview(); }