int columnCount = PrintGv.Columns.Count; int rowCount = PrintGv.Rows.Count; int tableRows = rowCount + 3; iTextSharp.text.Table grdTable = new iTextSharp.text.Table(columnCount, tableRows); grdTable.BorderWidth = 1; grdTable.BorderColor = new Color(0, 0, 255); grdTable.Cellpadding = 1; grdTable.Cellspacing = 1; grdTable.AddCell("ItemNo"); grdTable.AddCell("Qty"); grdTable.AddCell("Description"); for (int rowCounter = 0; rowCounter < rowCount; rowCounter++) { for (int columnCounter = 0; columnCounter < columnCount; columnCounter++) { string strValue = PrintGv.Rows[rowCounter].Cells[columnCounter].Text; grdTable.AddCell(strValue); } } Doc.Add(grdTable);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)