Don't skip empty cells on export
Make sure we output at least an empty string as a placeholder.
Fixes
@@ -80,10 +80,8 @@ final class SpreadsheetSerializer implements TabularSerializer {
for (int c = 0; c < cells.size(); c++) {
CellData cellData = cells.get(c);
- if (cellData != null && cellData.text != null) {
cellDatas.add(cellData2sheetCellData(cellData));
}
- }
rowData.setValues(cellDatas);
rows.add(rowData);
@@ -98,7 +96,11 @@ final class SpreadsheetSerializer implements TabularSerializer {
com.google.api.services.sheets.v4.model.CellData sheetCellData = new com.google.api.services.sheets.v4.model.CellData();
ExtendedValue ev = new ExtendedValue();
+ if (cellData == null || cellData.value == null) {
+ ev.setStringValue("");
+ } else {
ev.setStringValue(cellData.value.toString());
+ }
sheetCellData.setUserEnteredValue(ev);
