I have this script that downloads the data from an entire table in .xls format, I happen to make an entire listing on a single page and it does not get usual because it has a list that goes over 2000 lines. I made a paged table that shows 10 results at a time and wanted that regardless of the current paging when clicking the download button it would download the complete listing because it only makes the current pagination.
Note: I have not found anything that treats something similar, only entire listing in current pagination.
Thank you in advance!
<script type="text/javascript">
function salvaPlanilha() {
var htmlPlanilha = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>PlanilhaConciliador</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>' + document.getElementById("tabela").innerHTML + '</table></body></html>';
var htmlBase64 = btoa(htmlPlanilha);
var link = "data:application/vnd.ms-excel;base64," + htmlBase64;
var hyperlink = document.createElement("a");
hyperlink.download = "ArquivoConciliador";
hyperlink.href = link;
hyperlink.style.display = 'none';
document.body.appendChild(hyperlink);
hyperlink.click();
document.body.removeChild(hyperlink); } </script>