Permalink
Browse files

#2489 CSV export now treats header rows as non-numeric, even if the c…

…olumn is numeric
  • Loading branch information...
abhibeckert committed Jun 19, 2016
1 parent 50a0f18 commit ee78ced520cef27b67756232e2b86fc20f3b7cae
Showing with 7 additions and 1 deletion.
  1. +7 −1 Source/SPCSVExporter.m
View
@@ -232,6 +232,7 @@ - (void)exportOperation
}
// Retrieve the next row from the supplied data, either directly from the array...
BOOL forceNonNumericRow = NO;
if ([self csvDataArray]) {
csvRow = NSArrayObjectAtIndex([self csvDataArray], currentRowIndex);
}
@@ -241,6 +242,7 @@ - (void)exportOperation
if ([self csvOutputFieldNames]) {
csvRow = [streamingResult fieldNames];
[self setCsvOutputFieldNames:NO];
forceNonNumericRow = YES;
}
else {
csvRow = [streamingResult getRowAsArray];
@@ -298,8 +300,12 @@ - (void)exportOperation
[csvString appendString:[self csvEnclosingCharacterString]];
}
else {
// is this the header row?
if (forceNonNumericRow) {
csvCellIsNumeric = NO;
}
// If an array of bools supplying information as to whether the column is numeric has been supplied, use it.
if ([tableColumnNumericStatus count] > 0) {
else if ([tableColumnNumericStatus count] > 0) {
csvCellIsNumeric = [NSArrayObjectAtIndex(tableColumnNumericStatus, i) boolValue];
}
// Otherwise, first test whether this cell contains data

0 comments on commit ee78ced

Please sign in to comment.