title: How can I export a C# DataGridView to PDF using iTextSharp while **maintaining the custom currency formatting**?
body: <p>I'm trying to export a DataGridView with custom currency formatting to PDF using iTextSharp, the formatting shows up perfectly on the DataGrid when running the program but doesn't appear on the PDF once I save it.</p>
  
  <p>Here is the DataGridView code (showing the currency formatting):</p>
  
  <pre><code>    DataTable t = new DataTable();
  
              if (t != null)
              {
                  a.Fill(t);
  
                  //Custom currency formatting
                  var format =              (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
                  format.CurrencySymbol = "R";
  
                  dgvMiscEntries.AutoGenerateColumns = false;
  
                  dgvMiscEntries.ColumnCount = 2;
                   //Assign column headers manually
  
                  dgvMiscEntries.Columns[0].Name = "Description";
                  dgvMiscEntries.Columns[0].HeaderText = "Description";
                  dgvMiscEntries.Columns[0].DataPropertyName = "Description";
  
                  dgvMiscEntries.Columns[1].Name = "Rate";
                  dgvMiscEntries.Columns[1].HeaderText = "Rate";
                  dgvMiscEntries.Columns[1].DataPropertyName = "Rate";
                  dgvMiscEntries.Columns[1].DefaultCellStyle.FormatProvider =     format;
                  dgvMiscEntries.Columns[1].DefaultCellStyle.Format = "c";
  
  
                  // Render data onto grid
                  dgvMiscEntries.DataSource = t;
              }
  </code></pre>
  
  <p>And here is the iTextSharp code:</p>
  
  <pre><code>            //Creating iTextSharp Misc Entries Table from the DataTable data
              PdfPTable miscTable = new PdfPTable(dgvMiscEntries.ColumnCount);
              miscTable.DefaultCell.Padding = 3;
              float[] miscWidthPosit = new float[] { 1000f, 200f };
              miscTable.WidthPercentage = 80;
              miscTable.SetWidths(miscWidthPosit);
              miscTable.HorizontalAlignment = Element.ALIGN_CENTER;
              miscTable.DefaultCell.BorderWidth = 1;
              miscTable.SpacingBefore = 10;
              miscTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
  
              foreach (DataGridViewRow row in dgvMiscEntries.Rows)
              {
                  foreach (DataGridViewCell cell in row.Cells)
                  {
                      if (cell.Value != null)
                      {
                          miscTable.AddCell(cell.Value.ToString());
                      }
                  }
              }
  </code></pre>
  
  <p>I have searched for similar questions here and on other sites but I haven't found any addressing this particular problem.</p>