aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Documents/ExcelWriter.cs')
-rw-r--r--Software/Visual_Studio/Tango.Documents/ExcelWriter.cs22
1 files changed, 20 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs b/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
index 613bbd90f..63c04bce9 100644
--- a/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
+++ b/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs
@@ -52,9 +52,12 @@ namespace Tango.Documents
{
var item = list[i];
+ var last_row = sheetData.Elements<Row>().Last();
+
Row newRow = new Row();
+ newRow.RowIndex = last_row.RowIndex + 1;
- sheetData.InsertAfter(newRow, sheetData.Elements<Row>().Last());
+ sheetData.InsertAfter(newRow, last_row);
foreach (var prop in props)
{
@@ -77,7 +80,22 @@ namespace Tango.Documents
cell.CellReference = cellReference;
}
cell.CellValue = new CellValue(value.ToString());
- cell.DataType = CellValues.String;
+
+ cell.DataType = CellValues.Number;
+
+ if (value is String)
+ {
+ cell.DataType = CellValues.String;
+ }
+ else if (value is DateTime)
+ {
+ cell.DataType = CellValues.Date;
+ }
+ else if (value is Boolean)
+ {
+ cell.DataType = CellValues.Boolean;
+ }
+
row.Append(cell);
}