function createTableWithJson(tableName,json,sumfields,hideFields){
    var arrData1 = typeof json != 'object' ? JSON.parse(json) : json;
    let arrData = hideFields.length > 0 ? [] : arrData1;
    if(hideFields && hideFields.length > 0){
        arrData1.map((list)=>{
            let dataObj = {};
           Object.entries(list).map(([key,value])=>{
            if(!hideFields.includes(key)){
                dataObj[key] = value;
            }
           });
           arrData.push(dataObj);
        })
      }
  let tableData = '<table>';
  if(tableName){
    tableData+=`<tr><th style="text-align:center" colspan='${Object.keys(arrData[0]).length+1}' >${tableName.toUpperCase()}</th></tr>`;
  }
  tableData+='<tr><th>Sno</th>';
  for(let dataSelect in arrData[0]){
    tableData += `<th>${dataSelect.toUpperCase()}</th>`;
   }
  tableData+='</tr>';
  tableData += '</tr>';
  arrData.map((list,index)=>{
      tableData += `<tr><td>${index+1}</td>`;
     for(let dataSelect in list){
      tableData += `<td>${list[dataSelect]}</td>`;
     }
     tableData += '</tr>';
  });
  if(sumfields && sumfields.length > 0){
    tableData+='<tr><td >&nbsp</td>';
    Object.keys(arrData[0]).map((list)=>{
        let foundSum = sumfields.find((sumData)=> {return sumData.toUpperCase() == list.toUpperCase()});
        if(foundSum){
            let totalValue = 0;
            arrData.map(listSum=>{let value = isNaN(Number(listSum[foundSum])) ? 0 : Number(listSum[foundSum]) ; totalValue+=value});
            tableData +=`<td >${isNaN(totalValue)? totalValue : totalValue.toFixed(2)}</td>`;
        }else{
            tableData +=`<td >&nbsp</td>`;
        }
    })
    tableData+='</tr>';
  }
  tableData+='</table><br>'
  return tableData;
}