Am downloading an excel file by giving array input and with static headers. Here is my code snippet:
- function exporttoexcel(data){
- var tmpArr = [];
- var tmpArr2 = [];
- var csvData = [];
- tmpArr2.push("SCA Number","Contract(Project) Name");
- csvData.push(tmpArr2.join('\t'));
- for(var i=0;i<data.length;i++){
- tmpArr = [];
- tmpArr.push(data[i].Title);
- tmpArr.push(data[i].ContractName);
- csvData.push(tmpArr.join('\t'));
- }
- var output = csvData.join('\n');
- SaveContents(output);}
File download is working fine. My issue is to get the headers in excel file as bold, in the downloaded file. Anyway, I can achieve it by placing the data in HTML tags.But, I have to generate using array input. Can anyone suggest a better solution for this issue???