Column autofit
Can i do column autofit?
It's not possible at the moment. The best you can do is set column width individually via setColumnProperties.
Note that Autofit is a complex operation, requiring the knowledge of font metrics, and building the whole dataset in memory in order to compute the max string size for each column.
I'll keep this issue open as an enhancement. I may implement something for the default font in the future.
Ok I understand. Excellent work, by the way.
@mbleron Hi, how about to consider a setting of default column width, by column type (and width maybe)?
Below just a simple rough thought for example:
- char/varchar related: if column data length<=50 then C1 else C2
- date/timestamp: default to D
- numeric related: if value <= 10000000 then N1 else N2
- others: default to O
I think a kind of default column width setting may meet 90% cases, then we can set specific column width by setColumnProperties only when it's needed.
Regards Wicky