out of memory when exporting more than 100000 records to excel or csv
out of memory when exporting more than 100000 records to excel or csv
manuelPunzano
Posts: 1Questions: 1Answers: 0
Hello.
When I try to export my datatable with more than 100000 records to excel or csv I get an out of memory message in the browser.
Has anyone had this issue happen to him.
Here is how to perform the initialization of the datatable
table = $('#tabla_consultas').DataTable({
orderCellsTop: true,
data: result,
pageLength: 30,
autoWidth: true,
initComplete: function() {
$('#sidebar2').removeClass('active');
$('html').css('overflow','auto');
$('.overlay').removeClass('active');
},
dom: 'Bfrtip',
language: {
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "<b>Buscar:</b>",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate": {
"sFirst": "Primero",
"sLast": "Último",
"Page": "Página",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria": {
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
},
dom: 'Bfrtip',
buttons: [
{
extend: 'copyHtml5',
text: '<i class="fas fa-copy fa-3x" style="background: none;"></i>',
titleAttr: 'Copy',
title: name
},
{
extend: 'excelHtml5',
text: '<i class="fas fa-file-excel fa-3x" style="background: none;"></i>',
titleAttr: 'Excel',
title: name
},
{
extend: 'csvHtml5',
text: '<i class="fas fa-file-csv fa-3x" style="background: none;"></i>',
titleAttr: 'CSV',
title: name
},
],
columnDefs: columnas,
columns: title
});
Answers
It would be worth ensuring your on the most recent versions, as some changes were made in this area.
Colin