Skip to content

Commit 0b7c528

Browse files
committed
fix(ExcelExporter): Remove the null char from cell value
1 parent 74d3d1f commit 0b7c528

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

projects/igniteui-angular/src/lib/services/excel/excel-exporter.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ describe('Excel Exporter', () => {
144144
'Dorothy H. Spencer'
145145
], options);
146146

147+
wrapper.verifyStructure();
148+
await wrapper.verifyTemplateFilesContent();
147149
await wrapper.verifyDataFilesContent(actualData.noHeadersStringDataWithNullChars);
148150
});
149151

projects/igniteui-angular/src/lib/services/excel/test-data.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,8 +1937,8 @@ export class FileContentData {
19371937
}
19381938

19391939
public get noHeadersStringDataWithNullChars() {
1940-
this._sharedStringsData = `count="6" uniqueCount="6"><si><t>Column1</t></si><si><t>Terrance\&#32;Orta</t></si>` +
1941-
`<si><t>Richard Mahoney\&#32;LongerName</t></si><si><t>Donna\&#32;Price</t></si><si><t>Lisa Landers</t></si><si><t>` +
1940+
this._sharedStringsData = `count="6" uniqueCount="6"><si><t>Column1</t></si><si><t>TerranceOrta</t></si>` +
1941+
`<si><t>Richard MahoneyLongerName</t></si><si><t>DonnaPrice</t></si><si><t>Lisa Landers</t></si><si><t>` +
19421942
`Dorothy H. Spencer</t></si>`;
19431943

19441944
this._tableData = `ref="A1:A6" totalsRowShown="0"><autoFilter ref="A1:A6"/><tableColumns count="1">` +

projects/igniteui-angular/src/lib/services/exporter-common/export-utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export class ExportUtilities {
6969
.replace(/>/g, '&gt;')
7070
.replace(/"/g, '&quot;')
7171
.replace(/'/g, '&apos;')
72-
// Bug #14944 - Replace the not supported null character (\u0000, \x00) with a space
73-
.replace(/\0/g, '&#32;');
72+
// Bug #14944 - Remove the not supported null character (\u0000, \x00)
73+
.replace(/\x00/g, '');
7474
}
7575
}
7676
}

0 commit comments

Comments
 (0)