How to right align numeric columns in exported pdf and excel?
How to right align numeric columns in exported pdf and excel?
osamajaved
Posts: 12Questions: 6Answers: 0
How to right align numeric columns in exported pdf and excel?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
With the Excel export it should be done automatically. With the PDF export you would need to use the
customize
method of thepdfHtml5
button type, together with the pdfmake API to right align whatever cells it is that you need.I'll look at adding that by default in future.
Allan
Thank you Allan, It worked for me as follow:
Your solution worked for me @osamajaved . I only wanted certain columns to be re-aligned, not all.
EDIT: I only used:
var rowCount = doc.content[1].table.body.length;
for (i = 1; i < rowCount; i++) {
doc.content[1].table.body[i][4].alignment = 'right';
doc.content[1].table.body[i][5].alignment = 'right';
doc.content[1].table.body[i][6].alignment = 'right';
}
;},