Skip to content

Commit cc98c7e

Browse files
committed
fix(exporters): added callback for when data is empty #6673
1 parent be1af82 commit cc98c7e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

projects/igniteui-angular/src/lib/services/csv/char-separated-value-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export class CharSeparatedValueData {
3939

4040
public prepareDataAsync(done: (result: string) => void) {
4141
if (!this._data || this._data.length === 0) {
42-
return '';
42+
done('');
4343
}
4444

4545
const keys = ExportUtilities.getKeysFromData(this._data);
4646

4747
if (keys.length === 0) {
48-
return '';
48+
done('');
4949
}
5050

5151
this._isSpecialData = ExportUtilities.isSpecialData(this._data);

projects/igniteui-angular/src/lib/services/excel/excel-files.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,15 @@ export class WorksheetFile implements IExcelFile {
145145
});
146146
}
147147

148-
private prepareDataAsync(worksheetData: WorksheetData, done: (cols: string, rows: string) => void) {
148+
private prepareDataAsync(worksheetData: WorksheetData, done: (cols: string, sheetData: string) => void) {
149149
let sheetData = '';
150150
let cols = '';
151151
const dictionary = worksheetData.dataDictionary;
152152

153153
if (worksheetData.isEmpty) {
154154
sheetData += '<sheetData/>';
155155
this.dimension = 'A1';
156+
done('', sheetData);
156157
} else {
157158
sheetData += '<sheetData>';
158159
const height = worksheetData.options.rowHeight;

0 commit comments

Comments
 (0)