Ionic 3 PdfMake wont accepting array


#1

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


#2

I think the problem is in your service layer


#3

Here’s one with an actual array…


#4

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


#5

I’ve just updated the repo with a table.

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


#6

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.


#7

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
            ]
          }

#8

Thanks judgewest2000.

Really it was a great help from you.