Lets say i have a table and sometimes few data's can be null but null data are showing undefined at the table instead of showing undefine i want to show "N/A" how can i achieve that ill share an image and a code below.
at the above image under reference data some of the data showing undefine because it is null i want it to show "N/A". I'll share the code below. Below code there is "a.normalRange" variable that variable holds the reference data.
var col = ["Test Name", "Result", "Unit" , "Reference"];
this.xyz.forEach((a) => {
medicineInfo = this.xyz.find(x => x.id == a.id);
rows.push(['' + a.xyz+' '+ a.xyz+ '', '' + a.xyz+ '', '' + a.xyz,'' + a.xyz]);
});
And this is how i print the table
doc.autoTable({
columnStyles: {
0: { cellWidth: 45 },
1: { cellWidth: 45 },
2: { cellWidth: 45 },
3: { cellWidth: 45 }
},
head: [col],
body: rows,
startY: 100,
theme: 'plain',
tableLineColor: [242, 238, 238],
tableLineWidth: 0.5,
styles: {
font: 'courier',
lineColor: [242, 238, 238],
lineWidth: 0.5
},
});