NULL values are not considering as empty cells

Sep 3, 2014 at 3:15 PM
When we use LOADFROMDATATABLE method to export the datatable into excel file, if the datatable has NULL value in it the excel file shows empty cells. But when we select only those empty cells, it is showing the count at the bottom.

Normally in the excel file, if we select the empty cells it wont show the count at the bottom.

Appreciate if anyone could help me on this issue.

Thanks in Advance.

Sathish Selva
Editor
Sep 3, 2014 at 3:23 PM
Hi,

Please take a look at this thread http://epplus.codeplex.com/discussions/393289

Regards
Thiago
Marked as answer by chumsat on 9/4/2014 at 1:47 AM
Sep 4, 2014 at 8:21 AM
Hi Thiago,

Is it possible to have an updated DLL with the changes which was mentioned on this thread http://epplus.codeplex.com/discussions/393289


Appreciate your help.

Thanks in Advance.

Sathish Selva
Sep 4, 2014 at 8:47 AM
Hi Thiago,

Thanks for your answer. I was able to change the code and got the updated DLL.


Thanks a lot.

Sathish Selva
Sep 4, 2014 at 9:20 AM
I have changed the code in this way to make it working.
foreach (DataRow dr in Table.Rows)
{
      foreach (object value in dr.ItemArray)
     {                                  
          if (value != null && value.ToString() != string.Empty)
          {
             _worksheet._values.SetValue(row, col++, value);
          }
          else
          {
             col++;
          }
      }
      row++;
      col = _fromCol;
 }
Marked as answer by chumsat on 9/4/2014 at 2:22 AM