this.dataGridView1.Columns["Borç Tutari"].DefaultCellStyle.Format = "c"; PdfPTable pdftablosu = new PdfPTable(dataGridView1.Columns.Count); PdfPCell cell = new PdfPCell(new Phrase(cmbAracSube.Text + " NUMARALI ARAÇ/SUBE RAPORLARI", new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.COURIER, 12f, iTextSharp.text.Font.BOLDITALIC, iTextSharp.text.BaseColor.RED))); cell.Colspan = 5; cell.HorizontalAlignment = 1; pdftablosu.AddCell(cell); for (int j = 0; j < dataGridView1.Columns.Count; j++) { pdftablosu.AddCell(new Phrase(dataGridView1.Columns[j].HeaderText, new iTextSharp.text.Font(iTextSharp.text.Font.NORMAL, 8f, iTextSharp.text.Font.NORMAL,iTextSharp.text.BaseColor.BLUE))); } pdftablosu.HeaderRows = 1; for (int i = 0; i < dataGridView1.Rows.Count; i++) { for (int k = 0; k < dataGridView1.Columns.Count; k++) { if (dataGridView1[k, i].Value != null) { pdftablosu.AddCell(new Phrase(dataGridView1[k, i].Value.ToString())); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)