Datatable Export PDF with Inputs, not show input with data.

Datatable Export PDF with Inputs, not show input with data.

arcanisgkarcanisgk Posts: 20Questions: 6Answers: 0

Hello friends, I'm having some problems with exporting to PDF files, what happens is that I have a table with multiple input some are readonly other required etc ...
At the moment that I am filling this information I would like to know how I can export it and that the PDF capture them. Because by default I leave these columns blank.

Answers

  • arcanisgkarcanisgk Posts: 20Questions: 6Answers: 0

    Code:

    $('.DataTableHelper1').DataTable( {
            "dom": '<"html5buttons"B>rt<"bottom"><"clear">',
            "language": {
                "decimal":      ".",
                "emptyTable":       "No hay datos disponibles en la tabla",
                "info":         "Mostrando _START_ a _END_ de _TOTAL_ Registros",
                "infoEmpty":        "Mostrando 0 a 0 de 0 Registros",
                "infoFiltered":     "(Filtrado a Partir de _MAX_ Registros)",
                "infoPostFix":      "",
                "thousands":        ",",
                "lengthMenu":       "_MENU_",
                "loadingRecords":   "Cargando...",
                "processing":       "Procesando...",
                "search":       "Buscar:",
                "zeroRecords":      "No Encontrado - lo siento",
                "paginate": {
                    "first":        "Inicio",
                    "last":         "Ultimo",
                    "next":         "Siguiente",
                    "previous":     "Anterior"
                },
                "aria": {
                    "sortAscending":  ": activar para ordenar la columna ascendente",
                    "sortDescending": ": activar para ordenar la columna descendente"
                }
            },
            "iDisplayLength": -1,
            "lengthMenu": [[-1], ["All"]],
            "ordering": false,
            "scrollY": "300px",
            "scrollCollapse": true,
            buttons: [{
                extend: 'collection',
                text: 'Herramientas',
                buttons: [
                    {extend: 'copy', text: 'Copiar',exportOptions: {columns: ':visible'},},
                    {extend: 'excel', title: 'ArchivoExcel', text: 'Excel',exportOptions: {columns: ':visible'},},
                    {extend: 'pdfHtml5', title: 'ArchivoPDF', text: 'PDF',
                        orientation: 'landscape',
                        pageSize: 'LEGAL',
                        exportOptions: {
                            columns: ':visible',
                            stripHtml: true,
                        },
                    },
                    {extend: 'print', text: 'Imprimir',
                        customize: function (win){
                            $(win.document.body).addClass('white-bg');
                            $(win.document.body).css('font-size', '10px');
                            $(win.document.body).find('table')
                            .addClass('compact')
                            .css('font-size', 'inherit');
                        },
                        exportOptions: {columns: ':visible'},
                    },
                ]},
                {extend: 'colvis', text: 'Adm',},
                {
                    text: 'Ayuda',
                    action: function ( e, dt, node, config ) {
                        $.jAlert({
                            'title': 'Ayuda de Herramientas',
                            'content': msgtext,
                            'theme': 'blue',
                            'size': 'lg',
                            'showAnimation': 'fadeInUp',
                            'hideAnimation': 'fadeOutDown'
                        });
                    }
                },
            ]
        });
    
This discussion has been closed.