Goran Bibic

Goran Bibic

  • 454
  • 2.9k
  • 177.9k

Remove time in itextsharp pdf document for multiple colum c#

Jul 22 2019 4:37 AM
Date time remove time from pdf report need date an payment to be 01.01.2019   without time
if (c == 2) my report is

     date                             payment
01.01.2019             01.01.2019 00:00:00

I try to add this
if (c == 2) && (c == 3) my report is

         date                                                payment
01.01.2019 00:00:00                      01.01.2019 00:00:00

I try to add d (like on example code) if (c == 2) && (d == 3)
my report is

           date                                              payment
01.01.2019 00:00:00                       01.01.2019 00:00:00
 
Some help?
  1. //Adding DataRow  
  2. foreach (DataGridViewRow row in AnalitickaKarticaPartneraDataGridView.Rows)  
  3. {  
  4.   
  5.     int c = 0;  
  6.     int d = 0;  
  7.     foreach (DataGridViewCell cell in row.Cells)  
  8.     {  
  9.         if (c == 2 && d == 3)  
  10.         {
  11.            PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString().Split(' ')[0], calibri));
  12.             pdfTable.AddCell(cell2);  
  13.         }  
  14.         else  
  15.         {  
  16.             PdfPCell cell2 = new PdfPCell(new Phrase(cell.Value.ToString(), calibri));
  17.             pdfTable.AddCell(cell2);  
  18.         }  
  19.         c++;  
  20.         d++;  
  21.     }  
  22.   

Answers (7)