Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
felisberto_joao
Contributor III
Contributor III

Loading jspdf and jspdf-autotable

I´m loading the jspdf without problem but i´m getting an error when I load the autotable plugin. Does any all ready tried to do it?

Example from qlik help:

define([ '//code.highcharts.com/highcharts.js' ], function ( highCharts ) { 'use strict';  return { paint: function ( $element, layout ) {  // do something with highCharts } }; });


If a don´t load the autotable.js it work´s fine but I need the plugin.


My code:


define( ["jquery",

"qlik",

"https://unpkg.com/jspdf@latest/dist/jspdf.min.js",

"https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/2.3.4/jspdf.plugin.autotable.js",

"css!./SmartExport.css",

"./FileSaver",

"./jquery.wordexport"],

function (jquery,qlik,jsPDF/*,autotable*/) {


....



function printTable(){

  var autoTableFromData = function ( headers, data ) {

        var doc = new jsPDF();

        doc.autoTable(headers, data, {

            columnWidth: 'wrap',

            styles: {

                cellPadding: 0.5,

                fontSize: 8,

                overflow: 'linebreak'

            }

        });


        doc.save("output.pdf");

}


Best regards,

Felisberto


0 Replies