Ionic 3 PdfMake wont accepting array

Trying to push or concat array to table over pdfMake, getting empty values in output but data stored in array.

I think the problem is in your service layer

Here’s one with an actual array…

Can you explain some what brief. I didn’t get.

I’ve just updated the repo with a table.

It clearly works fine - so I’m not sure what your problem is.

I need to do like below

{
          style: 'tableExample',
          table: {
            body: [
              ['Column 1', 'Column 2', 'Column 3'],
              ['One value goes here', 'Another one here', 'OK?']
            ].concat(items)
          }
}

but it not accepting array to insert new table values.

If you check my repository now you can see it using spread notation…

One injected inline, and the other after the object has been created.

table: {
            body: [
              ...[['Column 1', 'Column 2', 'Column 3'],
              ['One value goes here', 'Another one here', 'OK?']],
              //THIS IS INLINE INJECTION USING THE SPREAD SYNTAX
              ...someTableBodyItemsInjectedInline
            ]
          }
1 Like

Thanks judgewest2000.

Really it was a great help from you.