private void btnPrintGrid_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = cboClubs.Text + " - Liste des membres"; printer.SubTitle = string.Empty; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageSettings.Landscape = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = string.Empty; printer.FooterSpacing = 15; printer.PrintDataGridView(grdMembers); }
private void ButtonPrint_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = TextDetallePrint.Text; printer.SubTitle = "Resultado de la consulta solicitada"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = ".::Restaurant.NET::. Juan Yonzo - Matias Soria"; printer.FooterSpacing = 15; printer.PrintDataGridView(DataGridConsultas); }
// BINDING NAVIGATORS - END // PRINT METHOD - START private void PrintDataGridView(int ListPanelIndex) { DGVPrinter printer = new DGVPrinter(); printer.Title = "Library Report | " + string.Format("Date: {0}", DateTime.Now.Date.ToString("dd/MM/yyyy")); //HEADER printer.SubTitle = " "; //SUBTITLE printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Printed with the DGVPrinter Class"; //FOOTER printer.FooterSpacing = 15; switch (ListPanelIndex) { case 0: printer.PrintDataGridView(dataGridViewBooks); break; case 1: printer.PrintDataGridView(dataGridViewAuthors); break; case 2: printer.PrintDataGridView(dataGridViewPublishers); break; default: break; } }
private void button27_Click(object sender, EventArgs e) { printer.Title = "\r\n\r\n\r\n ใบเสร็จรับเงิน \r\n\r\n ร้านเชตุพน \r\n"; printer.SubTitle = "ที่อยู่ 91 หมู่ที่ 3 ต.ตาเป๊ก อ.เฉลิมพระเกียรติ จ.บุรีรัมย์ \r\n เลขประจำตัวเสียภาษี 3 3104 00395 641 \r\n โทรศัพท์/โทรสาร 0 4462 8120 และ 081-760-7451 \r\n\r\n"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = false; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "ผู้รับเงิน .................................................................. \r\n วันที่ ......................................................................... \r\n\r\n หมายเหตุ : กรณีชำระด้วยเช็คสั่งจ่าย โปรดสั่งจ่ายในนาม ร้านเชตุพน และประทับตรา A/C PAYEE ONLY"; printer.FooterSpacing = 15; printer.PrintDataGridView(DGVbill); }
private void button2_Click(object sender, EventArgs e) { try { DGVPrinter printer = new DGVPrinter(); printer.Title = "Historique Entrées et sorties"; printer.SubTitle = string.Format("Date :{0}", DateTime.Now.Date.ToString("MM/dd/yyyy")); printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = true; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Go down"; printer.FooterSpacing = 15; printer.PageSize = new PaperSize("Custom", 5100, 6600); printer.PrintDataGridView(dgHistorique); } catch (Exception ex) { MessageBox.Show("Erreur " + ex.Message); } }
private void button2_Click(object sender, EventArgs e) { if (accCheck.Checked == true || expCheck.Checked == true) { string format = "dd MMMM yyyy"; string duration = startDate.Value.ToString(format) + " - " + endDate.Value.ToString(format); int originalWidth = accountsGrid.Width; int origianlHeight = accountsGrid.Height; accountsGrid.Dock = DockStyle.None; accountsGrid.Size = new Size(760, 842); expenseGrid.Dock = DockStyle.None; expenseGrid.Size = new Size(760, 842); try { if (accCheck.Checked == true) { DGVPrinter print = new DGVPrinter(); print.TitleFont = new Font("Franklin Gothic", 16.0f, FontStyle.Bold); print.SubTitle = duration; print.SubTitleFont = new Font(print.SubTitleFont.FontFamily, 10.0f); print.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; print.PageNumbers = true; print.PageNumberInHeader = false; print.HeaderCellAlignment = StringAlignment.Near; print.Footer = "Generated " + DateTime.Now.ToString("dddd, dd MMMM yyyy HH:mm:ss"); print.FooterFont = new Font("Franklin Gothic", 9.0f, FontStyle.Italic); print.FooterSpacing = 15.0f; //print.TableAlignment = DGVPrinter.Alignment.Center; print.Title = "Accounts"; print.PrintDataGridView(accountsGrid); } if (expCheck.Checked == true) { DGVPrinter print = new DGVPrinter(); print.TitleFont = new Font("Franklin Gothic", 16.0f, FontStyle.Bold); print.SubTitle = duration; print.SubTitleFont = new Font(print.SubTitleFont.FontFamily, 10.0f); print.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; print.PageNumbers = true; print.PageNumberInHeader = false; print.HeaderCellAlignment = StringAlignment.Near; print.Footer = "Generated " + DateTime.Now.ToString("dddd, dd MMMM yyyy HH:mm:ss"); print.FooterFont = new Font("Franklin Gothic", 9.0f, FontStyle.Italic); print.FooterSpacing = 15.0f; //print.TableAlignment = DGVPrinter.Alignment.Center; print.Title = "Expense Sheet"; print.PrintDataGridView(expenseGrid); } }catch (Exception ex) { MessageBox.Show("Error Occurred. Please try again", "Error"); } accountsGrid.Dock = DockStyle.Top; accountsGrid.Size = new Size(originalWidth, origianlHeight); expenseGrid.Dock = DockStyle.Top; expenseGrid.Size = new Size(originalWidth, origianlHeight); } }
//Print Fine Analysis Report private void btnPrintFineAnalysisReport_Click(object sender, EventArgs e) { //DataGridView Printer Java Class /***************************************************** * Title: C# Tutorial - Print DataGridView with Header & Footer with Landscape | FoxLearn * Author: FoxLearn * Site owner/sponsor: youtube.com * Date: 07 Nov 2016 * Availability: https://www.youtube.com/watch?v=-UB5mDPxAmo (Accessed 19 MARCH 2017) * Modified: Identifiers rename * *****************************************************/ //Print Fine Analysis Report //Instance of DGVPrinter DGVPrinter dgvPrinter = new DGVPrinter(); dgvPrinter.Title = "Fine Analysis Report"; //Header //\u20ac - Euro Symbol dgvPrinter.SubTitle = String.Format("Year: " + dtpFine.Text + "\nTotal Fine: \u20ac" + txtTotalFine.Text); //Sub-Header //StringFormatFlags specifies the display and layout information for text strings dgvPrinter.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; dgvPrinter.PageNumbers = true; dgvPrinter.PageNumberInHeader = false; dgvPrinter.PorportionalColumns = true; dgvPrinter.HeaderCellAlignment = StringAlignment.Near; dgvPrinter.Footer = "Revenue Analysis"; dgvPrinter.FooterSpacing = 15; dgvPrinter.printDocument.DefaultPageSettings.Landscape = false; dgvPrinter.PrintDataGridView(grdFineReport); //End of [non-original or refactored] code }
private void button1_Click(object sender, EventArgs e) { if (button1.Text == "SHOW UNCONFIRMED MARKS") { show_unconfirmed_marks(); button1.Text = "PRINT"; } else if (button1.Text == "PRINT") { DGVPrinter printer = new DGVPrinter(); printer.Title = "TRIBHUWAN UNIVERSITY" + "\n" + "INSTITUTE OF ENGINEERING";//Header printer.SubTitle = "College Name: " + comboBox8.Text + "\n" + "Theory/Practical: " + comboBox5.Text + "\n" + "Marks Unconfirmed List" + "\n" + "Batch: " + comboBox2.Text + "\n\n"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; // printer.Footer = "Signature: ______" + "\n" + "Name of Examiner: " + "\n" + string.Format("Date: {0}", DateTime.Now.Date.ToString("MM/dd/yyyy")); printer.FooterSpacing = 15; //Print landscape mode printer.printDocument.DefaultPageSettings.Landscape = true; printer.PrintDataGridView(dataGridView1); button1.Text = "SHOW UNCONFIRMED MARKS"; } }
private void endBtn_Click(object sender, EventArgs e) { /*newinvoice ni = new newinvoice(); * ni.Show();*/ DGVPrinter print = new DGVPrinter(); print.Title = "AutoParts Receipt"; if (clientBox == null) { print.SubTitle = string.Format(DateTime.Now.ToString("d/M/yyyy HH:mm:ss") + "|| Total amount: Eu" + totalP); } else { string cl = cNameBox.Text + " " + cSurnameBox.Text + " | "; print.SubTitle = cl + string.Format(DateTime.Now.ToString("d/M/yyyy HH:mm:ss") + "|| Total amount: Eu" + totalP); } print.TitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; print.PorportionalColumns = true; //print.Footer = "Total amount: Eu" + totalP; print.PageNumbers = false; print.PrintDataGridView(Grid1); }
//Print all data in datagrid by using DGVPrinter Class private void mnuPrint_Click(object sender, EventArgs e) { try { //check data available for print if (dgvCustomer.Rows.Count == 0) { MessageBox.Show("No data to print!"); } else { DGVPrinter printer = new DGVPrinter(); printer.Title = "Crosskey Customer Report"; printer.TitleColor = Color.DarkGreen; printer.SubTitle = string.Format("Date: {0}", DateTime.Now); printer.SubTitleSpacing = 20; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Center; printer.PrintDataGridView(dgvCustomer); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnPrint_Click(object sender, EventArgs e) { string value = dataGridView1.CurrentRow.Cells[0].Value.ToString(); if (!value.Equals("No Rows Found")) { String date = DateTime.Now.ToString("MM/dd/yyyy h:mm tt"); DGVPrinter printer = new DGVPrinter(); printer.Title = "Bug Audit History"; printer.SubTitle = "Bug Name : " + cboBugName.SelectedItem.ToString() + Environment.NewLine + "Date Printed : " + date; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Bug Tracking Application"; printer.FooterSpacing = 15; printer.PrintDataGridView(dataGridView1); } else { MessageBox.Show("No Rows found to be printed."); } }
private void button1_Click(object sender, EventArgs e) { try { int a = (int)netamount; string inwords = NumberToWords(a); DGVPrinter printer = new DGVPrinter(); printer.Title = "LIFEcare Hospital Pvt Ltd" + "\n" + "Kathmandu, Nepal" + "\n" + "PATIENT INVOICE" + "\n";//Header printer.SubTitle = "Invoice No.: " + label35.Text + "\n" + string.Format("Date: {0}", DateTime.Now.Date.ToString("MM/dd/yyyy")) + "\n" + "Patient ID: " + textBox12.Text + "\n\n" + "Patient Name: " + Pname.Text + " " + "Gender: " + Gender.Text + "\n\n" + "Date of Admission: " + Admitted_date.Text + " " + "Date of Discharge: " + label11.Text + "\n\n\n"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = false; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Taxable Amount: Rs " + sum.ToString() + "\n" + "Tax Amount: Rs " + tax.ToString() + "\n" + "\n" + "Net Total: Rs " + netamount.ToString() + "\n" + "In Words: " + inwords + " Only." + "\n\n" + "Invoice Prepared by: " + user_lbl.Text + "\n\n\n\n\n\n\n\n\n";//Footer printer.FooterSpacing = 15; //Print landscape mode printer.printDocument.DefaultPageSettings.Landscape = true; printer.PrintDataGridView(dataGridView1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ispisTablicaIteracijaToolStripMenuItem_Click(object sender, EventArgs e) { try { btnSimplex.PerformClick(); DGVPrinter printer = new DGVPrinter(); if (igrac == 1) { printer.Title = "Tablice iteracija igrača A: ";//zaglavlje } else { printer.Title = "Tablice iteracija igrača B: ";//zaglavlje } printer.TitleAlignment = StringAlignment.Near; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.DataWidth; printer.HeaderCellAlignment = StringAlignment.Near; printer.FooterSpacing = 10; printer.FooterAlignment = StringAlignment.Near; printer.printDocument.DefaultPageSettings.Landscape = true; printer.Footer = simplexForma.DohvatiRjesenjeProblema(); printer.PrintDataGridView(simplexForma.DohvatiTabliceIteracije()); } catch { MessageBox.Show("Ugasite trenutačno upaljeni PDF dokument i pokušajte ponovno!"); } }
void btnPrint_Click_1(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = "Продуктивність"; //printer.SubTitle = string.Format("Дата {0}", DateTime.Now); printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.HeaderCellAlignment = StringAlignment.Center; printer.ColumnWidths.Add("Проект", 100); printer.ColumnWidths.Add("Кількість чохлів", 100); printer.ColumnWidths.Add("Загальний час", 100); printer.ColumnWidths.Add("Час на одну штуку", 100); printer.ColumnWidths.Add("Час на салон", 100); printer.Footer = "BADER"; printer.FooterSpacing = 15; //printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.DataWidth; printer.PrintDataGridView(dataGridView1); }
public static void PrintRecords(DataGridView recordsDataGridView, string title) { try { schoolInfor sch = new schoolInfor(); DGVPrinter printer = new DGVPrinter(); recordsDataGridView.AutoSize = true; printer.Title = sch.SchoolName.ToUpper(); printer.SubTitle = title.ToUpper(); printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Motto: " + sch.Motto.ToLower(); printer.FooterSpacing = 15; printer.PrintDialogSettings.AllowPrintToFile = true; printer.ShowTotalPageNumber = true; printer.printDocument.DefaultPageSettings.Landscape = true; printer.PrintDataGridView(recordsDataGridView); } catch (Exception) { } }
public void Imprimir() { DGVPrinter printer = new DGVPrinter(); String HORA, FECHA; HORA = DateTime.Now.ToLongTimeString(); FECHA = DateTime.Now.ToLongDateString(); printer.Title = "Molduras y Cortineros\n"; printer.SubTitle = "HORA: " + HORA + " \nFECHA: " + FECHA + "\n\n Venta #" + idObtenida + "\nCAJERO: Roberto Carlos Hernández García"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = false; //comunmente va true printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "\n\nTOTAL: $" + total + "\nPAGO CON: $" + t_pago.Text.ToString() + "\nSU CAMBIO: $" + cambio + "\n\nGRACIAS POR SU COMPRA"; printer.FooterSpacing = 15; printer.PrintDataGridView(tabla_venta); tabla_venta.Rows.Clear(); tabla_venta.Refresh(); t_pago.Text = ""; total = 0; cambio = 0; }
private void button2_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = "Saad Musa-Home Textile"; printer.SubTitle = "Daily Attendance Report" + Environment.NewLine + "Date-" + dateTimePicker1.Value.ToString("dd/MM/yyyy") + Environment.NewLine + label5.Text.ToString() + Environment.NewLine + " "; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PrintMargins.Left = 10; printer.PrintMargins.Right = 10; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Saad Musa-IT Department"; printer.FooterSpacing = 15; printer.PrintDataGridView(viewAttendanceDataGridView); }
private void btnsaveandprint_Click(object sender, EventArgs e) { if (txtName.Text != "") { if (dgvAddedProduct.Rows.Count != 0) { save(); DGVPrinter printer = new DGVPrinter(); printer.Title = "Billing Management System\r\n"; printer.SubTitle = "Pune, Wagholi \r\n Contact: 123654\r\n\r\n"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Center; printer.Footer = "Discount : " + txtDiscount.Text + "%\r\n" + "GST : " + txtGst.Text + "%\r\n" + "Grand Total : " + txtGrandTotal.Text + "\r\n\r\n" + "Thank You for Doing Business with us"; printer.FooterSpacing = 15; printer.PrintDataGridView(dgvAddedProduct); MessageBox.Show("Print successfully"); } else { MessageBox.Show("Please Add Product Details"); } } else { MessageBox.Show("Please enter Customer Details"); } }
public void imprimir() { DGVPrinter printer = new DGVPrinter(); printer.Title = "Obrigado por com comprar"; printer.PrintDataGridView(dataGridView3); }
} //End //Print Button Event private void btnPrint_Click(object sender, EventArgs e) { //DataGridView Printer Java Class /***************************************************** * Title: C# Tutorial - Print DataGridView with Header & Footer with Landscape | FoxLearn * Author: FoxLearn * Site owner/sponsor: youtube.com * Date: 07 Nov 2016 * Availability: https://www.youtube.com/watch?v=-UB5mDPxAmo (Accessed 19 MARCH 2017) * Modified: Identifiers rename * *****************************************************/ //Print Member Borrow History (Listing) //Instance of DGVPrinter DGVPrinter dgvPrinter = new DGVPrinter(); dgvPrinter.Title = "Member Borrow History"; //Header dgvPrinter.SubTitle = String.Format("Name: " + lblMemName.Text + "\nDate: {0}", DateTime.Now.Date.ToString("dd/MM/yyyy")); //Sub-Header //StringFormatFlags specifies the display and layout information for text strings dgvPrinter.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; dgvPrinter.PageNumbers = true; dgvPrinter.PageNumberInHeader = false; dgvPrinter.PorportionalColumns = true; dgvPrinter.HeaderCellAlignment = StringAlignment.Near; dgvPrinter.Footer = "Library"; dgvPrinter.FooterSpacing = 15; dgvPrinter.printDocument.DefaultPageSettings.Landscape = true; dgvPrinter.PrintDataGridView(grdLoanList); //End of [non-original or refactored] code }
private void button1_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = "Cars sold by salesman"; string userName = dataGridView1.CurrentRow.Cells[6].Value.ToString(); printer.SubTitle = userName; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Volkswagen Bulgaria"; printer.FooterSpacing = 15; printer.PrintDataGridView(dataGridView1); }
private void btnPrint_Click(object sender, EventArgs e) { if (dgvSalary == null) { } else { DGVPrinter printer = new DGVPrinter(); printer.Title = "M/S TAS ENTERPRISE"; printer.SubTitle = "\r\n Salary Record " + "Print Date : " + DateTime.Now.ToShortDateString(); printer.TitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = " Powered By TAS"; printer.FooterColor = Color.DarkGray; printer.SubTitleSpacing = 15; printer.FooterSpacing = 15; printer.SubTitleColor = Color.LightSlateGray; printer.printDocument.DefaultPageSettings.Landscape = true; printer.PrintDataGridView(dgvSalary); } }
private void imprimircorte_Click(object sender, EventArgs e) { if (dgvcortecaja.Rows.Count > 0) { DGVPrinter printer = new DGVPrinter(); String HORA, FECHA; HORA = DateTime.Now.ToLongTimeString(); FECHA = DateTime.Now.ToLongDateString(); printer.Title = "GORDITAS MOYA\n"; printer.SubTitle = HORA + "\n" + FECHA + "\n\n\nCORTE DE CAJA"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Miguel Hidalgo #713" + "\nZona Centro El Mante" + "\nC.P. 89800" + "\nTel: 23-2-16-97"; printer.FooterSpacing = 15; printer.PrintDataGridView(dgvcortecaja); //MessageBox.Show("Se guardo exitosamente el reporte"); } else { MessageBox.Show("La tabla a imprimir esta vacia", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnprint_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = "Equipment Billing Report"; printer.SubTitle = "Equipment Bills Summary"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = false; printer.HeaderCellAlignment = StringAlignment.Center; printer.Footer = "DIAMOND SYSTEMS LIMITED"; printer.FooterSpacing = 10; printer.PrintDataGridView(kdvequipcon); }
private void button5_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; if (dataGridView1.Rows.Count > 0) { DGVPrinter printer = new DGVPrinter(); String hora, fecha; hora = DateTime.Now.ToLongTimeString(); fecha = DateTime.Now.ToLongDateString(); printer.Title = "VITROMANTE"; printer.SubTitle = fecha + "\n" + hora + "\nClientes"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = true; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Calle Manuel González #416, Zona Centro, CP.89800, El Mante\nTel.(831) 232-1788"; printer.FooterSpacing = 15; printer.PrintDataGridView(dataGridView1); } else { MessageBox.Show("¡La tabla se encuentra vacia, debe llenarla con algun dato!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); } Cursor.Current = Cursors.Default; }
private void btnImprimir_Click(object sender, EventArgs e) { try { DGVPrinter printer = new DGVPrinter(); if (opcion == 1) { printer.Title = "Nomina general"; } else if (opcion == 2) { printer.Title = "Resumen de empleado"; } else if (opcion == 3) { printer.Title = "Reporte de nomina por Fechas"; } printer.SubTitle = string.Format("Fecha: {0}", DateTime.Today.ToString("dd-MM-yyyy hh:mm tt")); printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = ""; printer.FooterSpacing = 15; printer.PrintDataGridView(dgvDatos); MessageBox.Show("El informe se ha IMPRESO / GUARDADO Exitosamente.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception) { MessageBox.Show("Ups!! ha ocurrido un error, consulte con soporte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button2_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = "Saad Musa-Home Textile"; DateTime date1 = dateTimePicker1.Value; DateTime date2 = dateTimePicker2.Value; //printer.SubTitle = string.Format("Date:{0}-{0}",date1.Date,date2.Date); printer.SubTitle = "Individual Attendance Report" + Environment.NewLine + date1.ToString("dd/MM/yyyy") + "-" + date2.ToString("dd/MM/yyyy") + Environment.NewLine + "Employee:" + label4.Text.ToString() + Environment.NewLine + " "; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Developed By- Saad Musa IT Department"; printer.FooterSpacing = 15; printer.PageSettings.Landscape = true; printer.PrintDataGridView(viewIndividualAttendanceDataGridView); }
private void button2_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; if (dataGridView2.Rows.Count > 0) { DGVPrinter printer = new DGVPrinter(); String hora, fecha; hora = DateTime.Now.ToLongTimeString(); fecha = DateTime.Now.ToLongDateString(); printer.Title = "VITROMANTE"; printer.SubTitle = "NOTA DE PEDIDO\nPedido:" + label9.Text + "\nCliente: " + ncliente + " Direccion: " + direccion + "\nFecha Pedido: " + fechaclientepedido + "\nFecha Entrega: " + fechaclienteentrega + "\nTelefono: " + telefono + "\nTotal: " + tot.Text + "\n"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = true; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "Calle Manuel González #416, Zona Centro, CP.89800, El Mante\nTel.(831) 232-1788\nGenerado: " + fecha + " , " + hora; printer.FooterSpacing = 15; printer.PrintDataGridView(dataGridView2); } else { MessageBox.Show("¡La tabla se encuentra vacia, debe llenarla con algun dato!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop); } Cursor.Current = Cursors.Default; }
private void button4_Click(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter(); printer.Title = "FAULT INFORMATION REPORT"; printer.SubTitle = "FAULT INFORMATION SUMMARY"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.FitBlackBox; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = false; printer.HeaderCellAlignment = StringAlignment.Center; printer.Footer = "DIAMOND SYSTEMS LIMITED"; printer.FooterSpacing = 10; printer.PrintDataGridView(kdvequipfaults); }
private void BtnPrint_Click_1(object sender, EventArgs e) { DGVPrinter printer = new DGVPrinter { Title = "Продуктивність", //printer.SubTitle = string.Format("Дата {0}", DateTime.Now); SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip, PageNumbers = true, PageNumberInHeader = false, HeaderCellAlignment = StringAlignment.Center }; printer.ColumnWidths.Add("Проект", 70); printer.ColumnWidths.Add("Кількість чохлів", 90); printer.ColumnWidths.Add("Загальний час", 100); printer.ColumnWidths.Add("Час на одну штуку", 110); printer.ColumnWidths.Add("Час на салон", 60); printer.ColumnWidths.Add("Кількість салонів", 60); printer.ColumnWidths.Add("Середній час на одну штуку", 40); printer.ColumnWidths.Add("Коефіцієнт/кількість компонентів", 40); printer.ColumnWidths.Add("Кількість компонент помножено на середній на одну штуку", 70); printer.ColumnWidths.Add("Prod. sets planned", 40); printer.Footer = "BADER"; printer.FooterSpacing = 15; //printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.DataWidth; printer.PrintDataGridView(dataGridView1); }
private void btnPrint_Click(object sender, EventArgs e) { // dgvProducts.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; DGVPrinter printer = new DGVPrinter(); printer.Title = "O.M.T Hardware Store\nBackOrder"; printer.SubTitle = "BackOrder List"; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = true; printer.PageNumberInHeader = false; printer.PorportionalColumns = false; printer.HeaderCellAlignment = StringAlignment.Near; printer.Footer = "O.M.T Hardware"; printer.FooterSpacing = 15; printer.PrintDataGridView(dgvProducts); }
public void GenerarReporteMovimientos() { tabla_movimientos.DataSource = MostrarMov2(); DGVPrinter printer = new DGVPrinter(); String HORA, FECHA; HORA = DateTime.Now.ToLongTimeString(); FECHA = DateTime.Now.ToLongDateString(); printer.Title = "REGISTRO DE MOVIMIENTOS\n"; //printer.SubTitle = "HORA: " + HORA + " \nFECHA: " + FECHA + "\n\n Venta #" + ultimo; printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip; printer.PageNumbers = false; //comunmente va true printer.PageNumberInHeader = false; printer.PorportionalColumns = true; printer.HeaderCellAlignment = StringAlignment.Near; //printer.Footer = "\n\n\n\nMonto total: " + TXTTOTAL.Text + "$"; printer.FooterSpacing = 15; printer.PrintDataGridView(tabla_movimientos); tabla_movimientos.Refresh(); }