- Home
- Forum
- ASP.NET Core - EJ 2
- Export to excel with totals
Export to excel with totals
Why is the total row exported to excel one cell left?
Like this:
This is the grid:
Excel export:
let gridObj = document.getElementById("grid").ej2_instances[0];
let datumOd = document.getElementById("cboxDatumOd").ej2_instances[0];
let datumDo = document.getElementById("cboxDatumDo").ej2_instances[0];
let filter = ejs.data.DataUtil.select(this.filterSettings.columns, ['field', 'value']), str = "";
for (var f = 0; f < filter.length; f++) {
str = str + filter[f].field + ": " + filter[f].value;
str = str + ((f + 1) === filter.length ? "" : " | ");
}
if (args.item.id === 'grid_excelexport') {
let excelExportProperties = {
header: {
headerRows: 4,
rows: [
{ cells: [{ colSpan: 1, value: "Razdoblje: " + datumOd.value.toLocaleDateString("hr-HR").replace(" ", "") + " - " + datumDo.value.toLocaleDateString("hr-HR").replace(" ", ""), style: { fontSize: 14, hAlign: 'Left', bold: false, } }] },
{ cells: [{ colSpan: 1, value: str, style: { fontSize: 12, hAlign: 'Left', bold: false, } }] },
{ cells: [{ colSpan: 1, value: "Vrijeme: " + new Date().toLocaleString("hr-HR"), style: { fontSize: 12, hAlign: 'Left', bold: false, } }] },
]
},
};
gridObj.excelExport(excelExportProperties);
}
Thanks!
- Share the Syncfusion dll version
- Share your ej2.min.js file version
- Are you facing any script error while exporting?
- Please reproduce the issue in the given sample or share any sample with issue if possible
- 2 Replies
- 3 Participants
-
BJ Bernard Jurlina
- Nov 16, 2021 10:00 PM UTC
- Nov 19, 2021 03:16 PM UTC