Esempio n. 1
5
        /// <summary>
        /// Botón de evento para imprimir el comprobante
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();
            printer.Title = "Reporte de participantes";
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |
                                          StringFormatFlags.NoClip;

            printer.PageNumbers = true;
            printer.PageNumberInHeader = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer = "CENTEC - Centro de Capacitación Tecnológica";
            printer.FooterSpacing = 15;
            printer.PreviewDialog = printPreviewDialog1;
            printer.PageSettings.Landscape = true;
            printer.PrintPreviewDataGridView(GridPart);
        }
Esempio n. 2
3
        private void btnPrint_Click(object sender, EventArgs e)
        {
            //这里开始执行打印操作
            DGVPrinter printer = new DGVPrinter();
            printer.Title = "北京人民出版社";
            printer.SubTitle = "明细清单";
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |
            StringFormatFlags.NoClip;
            printer.PageNumbers = true;
            printer.ShowTotalPageNumber = true;
            printer.PageNumberInHeader = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer = "页 脚";
            printer.FooterSpacing = 15;
            printer.PageSeparator = " / ";
            printer.PageText = "页";

            printer.PrintPreviewDataGridView(DataGridView1);
            // printer.PrintDataGridView(dataGridView1);
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DGVPrinter dg = new DGVPrinter();


            if (cbtables.Text == "Маршруты")
            {
                dg.Title = "Маршрут";

                dg.SubTitle            = System.String.Format("Дата:{0}", DateTime.Now.ToLongDateString());
                dg.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
                dg.PageNumbers         = true;
                dg.PageNumberInHeader  = false;
                dg.PorportionalColumns = true;
                dg.HeaderCellAlignment = StringAlignment.Near;
                dg.Footer        = "Автостанция \"Higway to Hell!\"";
                dg.FooterSpacing = 15;
                dg.PrintPreviewDataGridView(dgvman);
            }
            else if (cbtables.Text == "Продажи")
            {
                dg.Title               = "Продажи";
                dg.SubTitle            = System.String.Format("Дата:{0}", DateTime.Now.ToLongDateString());
                dg.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
                dg.PageNumbers         = true;
                dg.PageNumberInHeader  = false;
                dg.PorportionalColumns = true;
                dg.HeaderCellAlignment = StringAlignment.Near;
                dg.Footer              = "Автостанция \"Higway to Hell!\"";
                dg.FooterSpacing       = 15;
                dg.PrintPreviewDataGridView(dgvman);
            }
            else if (cbtables.Text == "Водители")
            {
                dg.Title               = "Водители";
                dg.SubTitle            = System.String.Format("Дата:{0}", DateTime.Now.ToLongDateString());
                dg.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
                dg.PageNumbers         = true;
                dg.PageNumberInHeader  = false;
                dg.PorportionalColumns = true;
                dg.HeaderCellAlignment = StringAlignment.Near;
                dg.Footer              = "Автостанция \"Higway to Hell!\"";
                dg.FooterSpacing       = 15;
                dg.PrintPreviewDataGridView(dgvman);
            }
            else if (cbtables.Text == "Автобусы")
            {
                dg.Title               = "Автобусы";
                dg.SubTitle            = System.String.Format("Дата:{0}", DateTime.Now.ToLongDateString());
                dg.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
                dg.PageNumbers         = true;
                dg.PageNumberInHeader  = false;
                dg.PorportionalColumns = true;
                dg.HeaderCellAlignment = StringAlignment.Near;
                dg.Footer              = "Автостанция \"Higway to Hell!\"";
                dg.FooterSpacing       = 15;
                dg.PrintPreviewDataGridView(dgvman);
            }
        }
Esempio n. 4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you really want to print this?", "Print", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                try
                {
                    string     total   = dataGridView1.Rows.Count.ToString();
                    DGVPrinter printer = new DGVPrinter();
                    printer.Title               = "Bhashani Hospital & Diagonstic Center";
                    printer.SubTitle            = "Mohiuddin Plaza, Kagmari Road, Babistand, Tangail" + "\n" + "List of Employees" + "\n" + "Total Employees : " + total;
                    printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |
                                                  StringFormatFlags.NoClip;
                    printer.PageNumbers         = true;
                    printer.PageNumberInHeader  = false;
                    printer.PorportionalColumns = true;
                    printer.HeaderCellAlignment = StringAlignment.Near;
                    printer.Footer        = "Developed By - " + "GSoft Technologies";
                    printer.FooterSpacing = 30;

                    printer.PrintPreviewDataGridView(dataGridView1);
                }
                catch (Exception error)
                {
                    MessageBox.Show("Failed to print data! " + error.Message.ToString(), "Failed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
Esempio n. 5
0
        public void printDGVPrinter()
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Projetos";
            printer.SubTitle            = " " + DateTime.Now.ToShortDateString();
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;

            printer.PorportionalColumns = true;
            //printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.Porportional;
            printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.DataWidth;
            printer.RowHeight   = DGVPrinter.RowHeightSetting.CellHeight;

            //Hide Columns
            printer.HideColumns.Add("Image");

            printer.HeaderCellAlignment = StringAlignment.Center;
            printer.Footer        = "Somar - ";
            printer.FooterSpacing = 15;

            printer.HideColumns.Add(" ");

            printer.CellFormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.NoWrap;
            printer.PrintSettings.DefaultPageSettings.PaperSize = new PaperSize("210 x 297 mm", 800, 800);
            printer.PrintSettings.DefaultPageSettings.Landscape = true;
            //printer.PrintSettings.DefaultPageSettings. = true;
            printer.PrintSettings.DefaultPageSettings.Margins = new Margins(3, 3, 3, 3);

            //printer.PrintDataGridView(dataGridView1);
            printer.PrintPreviewDataGridView(dataGridView1);
        }
Esempio n. 6
0
        private void PrintData()
        {
            Font       font1   = new Font("Free 3 of 9 Extended", 60);
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = StartB + barcode + StopB + "\r\n\r\n\r\n";
            printer.TitleFont           = font1;
            printer.SubTitle            = "Firefighter ID:   " + Firefighter + "\r\n" + "Station:  " + Station + "\r\n\r\n\r\n\r\n";
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.SubTitleSpacing     = 30;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer              = "Date: " + date + "  Time:  " + time;
            printer.FooterSpacing       = 15;
            printer.printDocument.DefaultPageSettings.Landscape = true;
            printer.RowHeight = DGVPrinter.RowHeightSetting.DataHeight;
            printer.RowHeight = DGVPrinter.RowHeightSetting.CellHeight;
            DGVPrinter.ImbeddedImage image1 = new DGVPrinter.ImbeddedImage();
            image1.ImageAlignment = DGVPrinter.Alignment.NotSet;
            image1.ImageLocation  = DGVPrinter.Location.Absolute;
            image1.ImageX         = 0;
            image1.ImageY         = 0;
            image1.theImage       = new Bitmap("C:/Users/Marcin/Desktop/NIFRS/Shared/NIFRS_logo.png");
            printer.ImbeddedImageList.Add(image1);
            printer.PrintPreviewDataGridView(dataGridView1);
        }
Esempio n. 7
0
        private void PrintePreview_button_Click(object sender, EventArgs e)
        {
            print_dgv = CopyDataGridView(dgv);
            for (int i = 0; i < chklst.Items.Count; i++)
            {
                if (!chklst.GetItemChecked(i))
                {
                    print_dgv.Columns.Remove(chklst.Items[i].ToString());
                }
            }
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = " ";
            printer.SubTitle            = " ";
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.ShowTotalPageNumber = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer              = "页 脚";
            printer.FooterSpacing       = 15;
            printer.PageSeparator       = " / ";
            printer.PageText            = "页";
            printer.PrintPreviewDataGridView(print_dgv);
        }
Esempio n. 8
0
        //menus
        private void toolStripMenuItemPrintClients_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = Program.DefaultPrinter();

            printer.Title  = "Клиенты";
            printer.Footer = "Складской отдел";
            printer.PrintPreviewDataGridView(dataGridViewClients);
        }
Esempio n. 9
0
        //menus mat
        private void toolStripMenuItemPrintMaterials_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = Program.DefaultPrinter();

            printer.Title  = "Материалы";
            printer.Footer = "Складской отдел";
            printer.PrintPreviewDataGridView(dataGridViewMaterials);
        }
        //TODO baski onizleme ya da yazdirma butonlari sadece tabloda satir varken calissin
        private void btnBaski_Click(object sender, EventArgs e)
        {
            if (SeciliHastaninSevkleri.Rows.Count == 0)
            {
                return;
            }

            DGVPrinter printer = new DGVPrinter();

            printer = YazdirmayaHazirla(printer);
            printer.PrintPreviewDataGridView(dgYapilanTahlil);
        }
Esempio n. 11
0
        private void PrintListByActivity_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Виды деятельности юр. лиц";
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.Footer              = "Виды деятельности";
            printer.FooterSpacing       = 15;
            printer.PrintPreviewDataGridView(EntityTable);
        }
Esempio n. 12
0
        private void PrintPreview(string Mode, string IsPrint)
        {
            this.Width = Mode == "porterate" ? 763 : 1019;
            ////------------ PRINT PREVIEW
            DGVPrinter printer = new DGVPrinter();

            printer.Title = LblCompanyName.Text;
            StringBuilder strSql = new StringBuilder();

            if (!string.IsNullOrEmpty(LblCompanyAddress.Text))
            {
                strSql.Append(LblCompanyAddress.Text + "\n");
            }
            if (!string.IsNullOrEmpty(LblCompanyPhoneNo.Text))
            {
                strSql.Append(LblCompanyPhoneNo.Text + "\n");
            }
            strSql.Append("\n");
            printer.SubTitle        = strSql.ToString() + LblReportName.Text + "\n" + LblReportFromToDate.Text;
            printer.SubTitleSpacing = 5;
            //printer.SubTitle = string.Empty;
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;

            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.ColumnWidth         = DGVPrinter.ColumnWidthSetting.Porportional;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer = "FY :- " + ClsGlobal.CompanyFiscalYear;

            if (null != MyPageSettings)
            {
                printer.printDocument.DefaultPageSettings = MyPageSettings;
            }

            printer.PageSettings.Landscape = Mode == "porterate" ? false : true;
            MyPageSettings.Margins         = new Margins(40, 60, 20, 60);
            printer.FooterSpacing          = 5;
            printer.PreviewDialog          = printPreviewDialog1;

            if (IsPrint == "YES")
            {
                printer.PrintDataGridView(Grid);
            }
            else
            {
                printer.PrintPreviewDataGridView(Grid);
            }
            this.Width = 1019;
        }
Esempio n. 13
0
        private void btInPhieu_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "HÓA ĐƠN BÁN SÁCH";
            printer.TitleColor          = Color.Red;
            printer.SubTitle            = "Ngày bán: " + dtpNgayBan.Value.Date.ToString("dd-MM-yyyy");
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.OwnerDraw          += Printer_OwnerDraw;
            printer.PrintPreviewDataGridView(dgvMatHang);
        }
Esempio n. 14
0
        public void imprimirListadoDGVPrinter(string porcentajeDto)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title    = empresasDAL.NombreEmpresa().ToString();
            printer.SubTitle = string.Format("Fecha: {0}", DateTime.Now.Date.ToString("dd/MM/yyy") + "                          "
                                             + cmbCliente.Text.ToString() + "   " + porcentajeDto);
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = false;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer        = string.Format("Telefono: " + (empresasDAL.TelefonoEmpresa().ToString())); /*lblImporteTotal.Text;*/
            printer.FooterSpacing = 15;
            printer.PrintPreviewDataGridView(dgvListado);
        }
Esempio n. 15
0
        public void imprimirFacturaDGVPrinter()
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Juntas MARCELO";
            printer.SubTitle            = string.Format("Fecha: {0}", DateTime.Now.Date.ToString("dd/MM/yyy"));
            printer.SubTitle            = string.Format("Telefono: 1136579253");
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = false;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer              = lblImporteTotal.Text;
            printer.FooterSpacing       = 15;
            printer.PrintPreviewDataGridView(dvgFactura);
        }
        //Generate Report using DGV Printer Class...
        private void button1_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Josepdam Port Services Ltd."; //Header
            printer.SubTitle            = textBox1.Text;                 //Sub-Header
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer              = "jps.ng"; //Footer
            printer.FooterSpacing       = 15;
            printer.PrintPreviewDataGridView(dataGridView1);
            printer.PrintDataGridView(dataGridView1);
        }
Esempio n. 17
0
        private void btPrint_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title = "Sensors";
            //printer.SubTitle = "An Easy to Use DataGridView Printing Object";
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |
                                          StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.ColumnWidth         = DGVPrinter.ColumnWidthSetting.Porportional;
            printer.HeaderCellAlignment = StringAlignment.Near;
            //printer.Footer = "Your Company Name Here";
            printer.FooterSpacing = 15;
            printer.PrintPreviewDataGridView(DGV);
        }
Esempio n. 18
0
        private void txtPrint_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Final Result";
            printer.SubTitle            = DateTime.Now.ToLongTimeString();
            printer.PageNumberColor     = Color.Black;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer              = "Naga City School of Arts And Trade";
            printer.FooterSpacing       = 15;
            printer.printDocument.DefaultPageSettings.Landscape = false;
            printer.PrintPreviewDataGridView(dataGridView1);
        }
Esempio n. 19
0
        /// <summary>
        /// This method will print the form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addNewRecordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = tc.TableName;//Header
            printer.SubTitle            = string.Format("Date: {0}", DateTime.Now.Date.ToString());
            printer.SubTitleFormatFlags = System.Drawing.StringFormatFlags.LineLimit | System.Drawing.StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.HeaderCellAlignment = System.Drawing.StringAlignment.Near;
            printer.Footer              = "Some Footer Titel";
            printer.FooterSpacing       = 15;
            printer.printDocument.DefaultPageSettings.Landscape = true;
            //printer.PrintDataGridView(dataGridView1);
            printer.PrintPreviewDataGridView(dataGridView1);
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DGVPrinter Printer = new DGVPrinter();

            Printer.Title               = "Stock Ledger Report";
            Printer.SubTitle            = String.Format("Date:{0}", DateTime.Now.Date.ToString("dd/mm/yyyy"));
            Printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            Printer.SubTitleSpacing     = 3;
            Printer.PageNumbers         = true;
            Printer.PageNumberInHeader  = false;
            Printer.PorportionalColumns = true;
            Printer.HeaderCellAlignment = StringAlignment.Near;
            Printer.Footer              = "Inventory Suite";
            Printer.FooterSpacing       = 5;
            Printer.printDocument.DefaultPageSettings.Landscape = false;
            Printer.PrintPreviewDataGridView(dgvStockLedgerReport);
        }
Esempio n. 21
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Factura";//header
            printer.SubTitle            = string.Format("Data: {0}", DateTime.Now.Date.ToString());
            printer.TitleFormatFlags    = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = true;
            printer.PrintHeader         = true;

            printer.PrintPreviewDataGridView(dataGridView);
            // printer.PrintDataGridView(dataGridView);
            //printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer        = "Footer";
            printer.FooterSpacing = 15;
        }
Esempio n. 22
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "Rekap Suara";
            printer.SubTitle            = string.Format("tanggal: {0}", DateTime.Now.ToString("dd/MM/yyyy hh:mm"));
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers         = true;
            printer.PageNumberInHeader  = false;
            printer.PorportionalColumns = false;
            printer.CellAlignment       = StringAlignment.Center;
            printer.HeaderCellAlignment = StringAlignment.Near;
            printer.Footer              = "KPUD Yogyakarta";
            printer.FooterSpacing       = 15;
            printer.printDocument.DefaultPageSettings.Landscape = true;
            printer.PrintPreviewDataGridView(dgvRekap);
            printer.PrintDataGridView(dgvRekap);
        }
Esempio n. 23
0
        /// <summary>
        /// 打印预览
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            printer.Title               = "来料报检单";
            printer.SubTitle            = string.Format("到货单号:{0}          到货日期:{1}             报检人:{2}              报检日期时间:          ", this.txtArriveBarcode.Text.Trim(), DateTime.Now.ToShortDateString(), grideMes.Columns["供应商名称"], userAcount);
            printer.Qr_Message          = this.txtArriveBarcode.Text.Trim();
            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            //printer.PageNumbers = true;
            //printer.ShowTotalPageNumber = true;
            //printer.PageNumberInHeader = false;
            //printer.PorportionalColumns = true;
            //printer.HeaderCellAlignment = StringAlignment.Near;
            //printer.Footer = "页 脚";
            //printer.FooterSpacing = 15;
            //printer.PageSeparator = " / ";
            //printer.PageText = "页";
            printer.PrintPreviewDataGridView(grideMes);
        }
Esempio n. 24
0
        private void Print_Table()
        {
            DGVPrinter printer = new DGVPrinter();

            //add title
            printer.Title = "Cable Sizing Result";

            //add subtitle
            /*printer.SubTitle = ""; */

            printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |

                                          StringFormatFlags.NoClip;

            printer.PageNumbers = true;

            printer.PageNumberInHeader = false;

            printer.HeaderCellAlignment = StringAlignment.Near;

            /*printer.Footer = ""; */

            printer.FooterSpacing = 15;


            for (int i = 0; i < 40; i++)
            {
                printer.ColumnStyles[dataGridView1.Columns[i].Name] = dataGridView1.DefaultCellStyle.Clone();
                printer.ColumnHeaderStyles[dataGridView1.Columns[i].Name] = dataGridView1.DefaultCellStyle.Clone();
                printer.ColumnHeaderStyles[dataGridView1.Columns[i].Name].Font = new Font("Arial", (float)4);
                printer.ColumnHeaderStyles[dataGridView1.Columns[i].Name].Alignment = DataGridViewContentAlignment.MiddleCenter;
                printer.ColumnStyles[dataGridView1.Columns[i].Name].Font = new Font("Arial", (float)4);
                printer.ColumnStyles[dataGridView1.Columns[i].Name].Alignment = DataGridViewContentAlignment.MiddleCenter;
            }

            printer.ColumnWidth = DGVPrinter.ColumnWidthSetting.DataWidth;

            printer.PrintPreviewDataGridView(dataGridView1);
        }
Esempio n. 25
0
 //Generate Report to PDF using DGV Printer Class:
 //Printer Configurations:
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         DGVPrinter printer = new DGVPrinter();
         printer.Title               = "Hanover Terminal Ltd."; //Customize Header Here
         printer.SubTitle            = textBox1.Text;           //Customize Sub-Header Here
         printer.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
         printer.PageNumbers         = true;
         printer.PageNumberInHeader  = false;
         printer.PorportionalColumns = true;
         printer.HeaderCellAlignment = StringAlignment.Near;
         printer.Footer              = "www.hanoverterminal.com"; // Customize Footer Here
         printer.FooterSpacing       = 15;
         printer.PrintPreviewDataGridView(dataGridView1);
         printer.PrintDataGridView(dataGridView1);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void Btn_print_Click(object sender, EventArgs e)
 {
     try
     {
         DateTime   currentime = DateTime.Now;
         DGVPrinter printer    = new DGVPrinter();
         printer.PageNumbers         = false;
         printer.Title               = "Patient Payment Report";
         printer.SubTitle            = "Name: " + fname + " " + lname + " | Total Price: " + price_sum.ToString();
         printer.HeaderCellAlignment = StringAlignment.Center;
         printer.PorportionalColumns = true;
         printer.Footer              = string.Format("Date {0}", currentime.ToString("dd/MM/yyyy hh:mm tt"));
         printer.FooterSpacing       = 15;
         printer.PageSeparator       = " / ";
         printer.PageText            = "123";
         printer.PrintPreviewDataGridView(dataGridView1);
     }
     catch
     {
         MessageBox.Show("Nothing to print!", "Notification");
     }
 }
        /// <summary>
        /// This method can be moved to its own class and cofigured that the values like company name email, phone number
        /// can be created from admin dash board
        /// </summary>
        private void PrintTransaction()
        {
            var printRecord = new DGVPrinter();

            printRecord.Title    = "\r\n\r\n Better Store Nigeria Limited";
            printRecord.SubTitle = "\r\n No 32 Obange street Lekki Lagos \r\n 08135466998\r\n\r\n"
                                   + "Discount: " + discountbox.Text + "% \r\n" + "VAT: " + vatbox.Text + "% \r\n"
                                   + "Grand Total: " + decimal.Parse(grandtotalbox.Text).ToString("C") + "\r\n"
                                   + "Paid Amount: " + decimal.Parse(paidamountbox.Text).ToString("C")
                                   + "\r\n"
                                   + "Return Change: " + decimal.Parse(returnamountbox.Text).ToString("C")
                                   + "\r\n\r\r\n";
            printRecord.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printRecord.PageNumbers         = true;
            printRecord.PageNumberInHeader  = false;
            printRecord.PorportionalColumns = true;
            printRecord.HeaderCellAlignment = StringAlignment.Near;
            printRecord.Footer        = "Thank you for doing business with us.";
            printRecord.FooterSpacing = 250;

            printRecord.PrintPreviewDataGridView(productadded);
            // printRecord.PrintDataGridView(productadded);
        }
Esempio n. 28
0
        private void BtnToPrint_Click(object sender, EventArgs e)
        {
            DGVPrinter printer = new DGVPrinter();

            if (ChRemainder || DataGrid.ColumnCount == 5)
            {
                printer.Title    = "Отчет по остаткам";
                printer.SubTitle = $"На дату {dtDateRemainder.Value.ToString("d")}";
            }
            else
            {
                if (chAllTime.Checked)
                {
                    printer.Title    = "Отчет о движении деталей";
                    printer.SubTitle = $"За все время";
                }
                else
                {
                    printer.Title    = "Отчет о движении деталей";
                    printer.SubTitle = $"За период с {dtFromDate.Value.ToString("d")} до {dtToDate.Value.ToString("d")} ";
                }
            }
            printer.SubTitleFormatFlags    = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
            printer.PageNumbers            = true;
            printer.PageNumberInHeader     = false;
            printer.PorportionalColumns    = false;
            printer.PageSettings.Landscape = true;
            printer.HeaderCellAlignment    = StringAlignment.Near;
            printer.FooterSpacing          = 15;
            try
            {
                printer.PrintPreviewDataGridView(DgvReport);
            }
            catch (Exception)
            {
            }
        }
Esempio n. 29
0
 private void tsMenuPreview_Click(object sender, System.EventArgs e)
 {
     printer.PrintPreviewDataGridView(dgRanks);
 }