I wanted to be able to specify column widths by pixel or character in Excel output. The purpose of the gem is to stream out data, so the idea of scanning every source data row in an attempt to get the maximum column width needed to cover all rows is obviously not tenable. However, we can often either know some of the widths up front (e.g. contains a date-time, or a UUID, or whatever), or we might get useful initial width estimations from just the first few rows of data, computing that up-front before streaming out the spreadsheet. It's this latter approach that I've just used in a Rails application that's streaming data out via the gem fork I've built.
I wanted to be able to specify column widths by pixel or character in Excel output. The purpose of the gem is to stream out data, so the idea of scanning every source data row in an attempt to get the maximum column width needed to cover all rows is obviously not tenable. However, we can often either know some of the widths up front (e.g. contains a date-time, or a UUID, or whatever), or we might get useful initial width estimations from just the first few rows of data, computing that up-front before streaming out the spreadsheet. It's this latter approach that I've just used in a Rails application that's streaming data out via the gem fork I've built.