Pdfmake: Cannot read property '_minWidth' of undefined

Created on 25 Jun 2014  路  5Comments  路  Source: bpampuch/pdfmake

I stumbled upon this error when trying to include the colSpan.

[{ text: 'header ', colSpan: 3, style: 'header', alignment: 'center' }],
answered question

Most helpful comment

you have to provide empty elements if you use colSpan/rowSpan
[{text: 'header', colSpan: 3, style: 'header', alignment: 'center'}, {}, {}],

All 5 comments

you have to provide empty elements if you use colSpan/rowSpan
[{text: 'header', colSpan: 3, style: 'header', alignment: 'center'}, {}, {}],

in fact they don't have to be empty, but their content will be ignored; it's just important to keep the number of elements equal for all rows

Don't you think it's inefficient to have extra {} to be appended?

inneficient? no,
inconvenient? possibly

I'd been thinking about it for a long time before I implemented spans. Although your idea seems fine for colspans, it doesn't look natural when you start using rowspans.

So eventually I've decided to keep equal number of cells in each row

i am new to pdfMake ... so i have this doubt ? i want to have a table like this.
untitled

but when i use colspan=4 .. it gives me an error saying "Cannot read property '_minWidth' of undefined".

code:

body: [
          [{ text: '', style: 'tableHeader', colSpan: 4, alignment: 'center' },{},{},{},{ text: 'Accepted', style: 'tableHeader', colSpan: 2, alignment: 'center' }, {},{ text: 'Rejected', style: 'tableHeader', colSpan: 5, alignment: 'center' },{},{},{},{},{ text: 'total', style: 'tableHeader', alignment: 'center' }],

                  [{ text: 'Authenticator', style: 'tableHeader', alignment: 'center' },{ text: 'Name', style: 'tableHeader', alignment: 'center' },{ text: 'Types', style: 'tableHeader', alignment: 'center' },{ text: 'Container', style: 'tableHeader', alignment: 'center' },{ text: '#', style: 'tableHeader', alignment: 'center' },{ text: '%', style: 'tableHeader', alignment: 'center' }, { text: 'ProcError', style: 'tableHeader', alignment: 'center' }, { text: 'AuthError', style: 'tableHeader', alignment: 'center' },{ text: 'lookupError', style: 'tableHeader', alignment: 'center' },{ text: '#', style: 'tableHeader', alignment: 'center' },{ text: 

alignment: 'center' }, { text: 'AuthError', style: 'tableHeader', alignment: 'center' },{ text: 'lookupError', style: 'tableHeader', alignment: 'center' },{ text: '#', style: 'tableHeader', alignment: 'center' },{ text:'%', style: 'tableHeader', alignment: 'center' }, { text: 'total', style: 'tableHeader', alignment: 'center' }],

         [ 'Sample value 1', 'Sample value 2', 'Sample value 3','Sample value 4', 'Sample value 5', 'Sample value 3','Sample value 6', 'Sample value 7', 'Sample value 8','Sample value 9', 'Sample value 10', 'Sample value 11','Sample value 12'],        

]

thanks in advance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Christian24 picture Christian24  路  3Comments

svenyonson picture svenyonson  路  3Comments

davidyeiser picture davidyeiser  路  3Comments

Masber picture Masber  路  3Comments

kamilkp picture kamilkp  路  3Comments