Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update index.js for xlsx file download.
Previously it was only supporting xls format but I updated it to xlsx which is more secure and trustable excel file format.
  • Loading branch information
MrigankTarento authored Nov 8, 2021
commit 1f6c95390ba16c156333274586462bff187d133a
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var ReactHTMLTableToExcel = function (_Component) {

var table = document.getElementById(this.props.table).outerHTML;
var sheet = String(this.props.sheet);
var filename = String(this.props.filename) + '.xls';
var filename = String(this.props.filename) + '.xlsx';

var uri = 'data:application/vnd.ms-excel;base64,';
var template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-mic' + 'rosoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><meta cha' + 'rset="UTF-8"><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:Exce' + 'lWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/>' + '</x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></' + 'xml><![endif]--></head><body>{table}</body></html>';
Expand Down