Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82031

Is there any way to print the title and messageTop on each print sheet?

$
0
0

Is there any way to print the title and messageTop on each print sheet?

```{
extend: 'print',
title: (options.reporte).toUpperCase(),
messageTop: \n Fecha de creacion: ${new Date().getDate().toString()}/${(new Date().getMonth() + 1).toString()}/${new Date().getFullYear().toString()} \n Hora: ${new Date().getHours().toString()}:${new Date().getMinutes().toString()}:${new Date().getSeconds().toString()} \n Usuario: ${JSON.parse(localStorage.getItem("currentUser")).nombreUsuario} ${JSON.parse(localStorage.getItem("currentUser")).apellidoUsuario},
text: '<i class="fa fa-print"></i> Imprimir',
titleAttr: 'Imprimir',
exportOptions: {
columns: function (idx, data, node) {
if ($(node).hasClass('noVis')) {
return false;
}
let tableID = $(node).closest('table').attr('id');
return tableID === undefined ? false : $(tableID).DataTable().column(idx).visible();
}
},
customize: function (win) {

                        $(win.document.body).css('font-size', '10px');
                        $(win.document.body).find('table')
                            .addClass('compact')
                            .css('font-size', 'inherit')
                        $(win.document.body).find('thead').css({
                            "color": "black",
                            "font-size": "10px",
                            "font-weight": "bold",
                            "text-align": "center"
                        })
          }

}```


Viewing all articles
Browse latest Browse all 82031

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>