0
votes

I'm developing a program that write some sql querys to excel file using ClosedXML library. I used executeEscalar() to store the values on a List of Decimal:

List<Decimal> lista4 = new List<decimal>();
using (SqlCommand command2 = new SqlCommand(query3,conn2)) { //16 - PRIMA
command2.Parameters.AddWithValue("@codigo", codigo);
var res1 = command2.ExecuteScalar();
if (res1 != DBNull.Value)
lista4.Add(Convert.ToDecimal(res1));

The values are stored correctly at List as decimal values, but, when the list is inserted on the excel cells, when I open the excel file, the cells show 0 values:

var rangeWithData = ws.Cell("E9").InsertData(lista4);
1

1 Answers

0
votes

It was a bug but already been fixed. Pick up the latest source code on http://closedxml.codeplex.com