public bool A4PrintSelectPrint(string printContent, int printContentLineCount) { //PrintDocument doc = new TextDocument(printContent, printContentLineCount); PrintDocument doc = new TextDocument(printContent);//@Salim doc.PrintPage += this.printDocument1_PrintPage; PrintDialog printDialog1 = new PrintDialog(); // pageSetupDialog1 = new PageSetupDialog(); if (printDialog1.ShowDialog() == DialogResult.OK) { // printDialog1.ShowDialog(); if (printDialog1.PrinterSettings.PrinterName != null) { if (printDialog1.PrinterSettings.PrinterName != null) { doc.DefaultPageSettings.PrinterSettings.PrinterName = printDialog1.PrinterSettings.PrinterName; // doc.DefaultPageSettings.PrinterSettings.PrinterName = printDialog1.PrinterSettings.PaperSizes ; } doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; //if (dlgSettings.ShowDialog() == DialogResult.OK) //{ doc.Print(); } } return true; }
private void PrintDocument() { int printlenght = reportdataGridView.Rows.Count + 30; PrintDocument doc = new TextDocument(PrintReport(), printlenght); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; dlgSettings.UseEXDialog = true;// use for 64 bit operating system if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } }
private void PrintDocumentForPOS(Reservation partyReservation, string sr) { //int printlenght = oItemList.Count + 30; printReportLogoType = 2; PrintDocument doc = new TextDocument(PrintReportForPOS(), 50); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; dlgSettings.UseEXDialog = true; if (dlgSettings.ShowDialog() == DialogResult.OK) { if (sr == "Confirm") { for (int i = 0; i < 3; i++) { doc.Print(); } } else { doc.Print(); } } }
private void btnPrint_Click(object sender, EventArgs e) { /* printDocument1.DefaultPageSettings.Landscape = true; if (printDialog1.ShowDialog() == DialogResult.OK) { printDocument1.Print(); } */ int printlenght = oItemList.Count + 30; PrintDocument doc = new TextDocument(PrintReport(oItemList), printlenght); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; dlgSettings.UseEXDialog = true;// use for 64 bit operating system if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } }
private void printbutton_Click(object sender, EventArgs e) { int printlenght = DatewiseTotals.Count + 30; PrintDocument doc = new TextDocument(PrintReport(DatewiseTotals), printlenght); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; dlgSettings.UseEXDialog = true; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } }
private void functionalButton1_Click(object sender, EventArgs e) { try { printReportLogoType = 1; int printlenght = categorydataGridView.Rows.Count + 28; DataView dv = (DataView)(categorydataGridView.DataSource); DataTable dtt = dv.ToTable(); PrintDocument doc = new TextDocument(PrintReport(dtt), printlenght); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.UseEXDialog = true; dlgSettings.Document = doc; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } } catch (Exception) { } }
private void PrintReport(string printstring ,int length) { //int printlenght = oItemList.Count + 30; PrintDocument doc = new TextDocument(printstring, length); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; dlgSettings.UseEXDialog = true; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } }
private void btnRPPrintSummary_Click(object sender, EventArgs e) { PrintDocument doc = new TextDocument(getSummaryPrintDoc(dateRangeText, 29, true)); doc.PrintPage += this.Doc_PrintPage; //doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } // tempPrintMethods.USBPrint(getSummaryPrintDoc(dateRangeText, 29), PrintDestiNation.CLIENT, false); }
private void btnPrint_Click(object sender, EventArgs e) { printReportLogoType = 1; int printlenght = dtFood.Rows.Count + dtNonFood.Rows.Count + 28; PrintDocument doc = new TextDocument(PrintReport(dtFood, dtNonFood), printlenght); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } //tempPrintMethods.USBPrint(getSummaryPrintText(dateRangeText, 29, true), PrintDestiNation.CLIENT, false); }
private void btnPrintA4_Click(object sender, EventArgs e) { if (tableReport == null) { MessageBox.Show("No Data found"); return; } PrintDocument doc = new TextDocument(PrintReportA4()); doc.PrintPage += this.Doc_PrintPage; doc.DefaultPageSettings.Landscape = true; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } }