title: How to pass data through JSON to jsPDF autotable
body: <pre><code>download() {
      var columns = [
          { title: "Producto", dataKey: "producto" },
          { title: "Fecha", dataKey: "fecha" }
      ];
      var data = [{ "producto": "ddf", "fecha": "cwx" }];
      var doc = new jsPDF('p', 'pt');
      console.log("1", data);
      console.log("2", columns);
      doc.autoTable(columns, data);
      doc.save('table.pdf');            
      //console.log("3", data);
      //this.PdfServiceService.getAll().subscribe(c =&gt; {
      //    console.log("4", this.country = c.pdfdata)
      //    this.data = this.country;
      //});  
  };
  
  &lt;button (click)="download()"&gt;Generate PDF&lt;/button&gt;
  </code></pre>
  
  <p>I want to pass data (<code>var data</code>) through JSON data. I'm not able to pass the data into the doc auto table. This is the link I have tried: <a href="https://www.npmjs.com/package/jspdf-autotable" rel="nofollow noreferrer">https://www.npmjs.com/package/jspdf-autotable</a></p>