dhatim / fastexcel

Generate and read big Excel files quickly
Other
669 stars 121 forks source link

Writing Excel file needs percentage format #215

Closed Jack-eliteSoho closed 1 year ago

Jack-eliteSoho commented 1 year ago

When writing to an Excel, for number formatter, can't locate percentage formatter, like 1.234%.

Jack-eliteSoho commented 1 year ago

we have figured to use % formatter in Excel Export.

But when adding % to the column, the auto width gets messed, and the width is short of the % character, and the column auto width is not wide enough to display ##% format.

how do we tell the column auto width to take the % space in the width calculation?

ochedru commented 1 year ago

Currently, the column width is automatically computed using simple heuristics (see private method Worksheet.writeCols(Writer, int). There are no plan to improve this, but PRs are welcome. See also issue #35. My best advice at this time is to set the column width manually using Worksheet.width(int, double).