After downloading the xlsx file, I need to sum time values and see the average, total, count etc in the status bar.
I have attached the screenshot of current situation is showing 0.
TS code
public exportAsExcelFile(summary:any[], json: any[], excelFileName: string): void {
let report = "Global Service Desk SLA";
let ReportName = [{"Report":`Report Name : ${report}`}];
const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(ReportName ,{skipHeader:true});
if(worksheet['A2'] == undefined){
worksheet['A2'] = {"t":"s","v":`Date Range : ${summary[0].FromDate +" - "+summary[0].ToDate}`};
}
if(worksheet['A3'] == undefined){
worksheet['A3'] = {"t":"s","v":`Bot : ${summary[0].Bot}`}
}
if(worksheet['A4'] == undefined){
worksheet['A4'] = {"t":"s","v":`Timezone : ${summary[0].timeZone}`}
}
const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data']};
XLSX.utils.sheet_add_json(worksheet,json,{origin:"A7"});
const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
this.saveAsExcelFile(excelBuffer, excelFileName);
}
If I select the queue time column like screenshot average total is showing 0 i need the sum of total values in Average section
Working if I change hh:mm:ss to h:mm:ss
If I remove single 0 in that column cell the average total is showing please see in my screenshot
How can I enforce this type through code using SheetJS library? Or is there some other way to let Excel calculate the sum for hh:mm:ss
formatting?