https://bz.apache.org/bugzilla/show_bug.cgi?id=58896
--- Comment #8 from Javen O'Neal <[email protected]> --- Your input file has a few things beyond my unit test from comment 3: 1) Rich Text Formatting (bold, color) 2) Number formatting ($128,000) 3) Merged cells (Description) How much do each of these contribute to the 132.5 seconds? Could you time your auto-size code from comment 5 using an Excel file with: A) no formatting B) 1+2+3 formatting C) 1, 2, and 3 formatting, separately, if A and B are different As a side-note: if you are using POI to auto-size a file similar to attachment 33635 and you know the workbook structure, you could either manually determine ideal column widths and use POI to explicitly set the widths, or have POI calculate the best-fit width of the first group of columns, then apply those widths to all of the columns. This obviously doesn't work when the content is less structured or there are longer strings. Andi suggested that some people could get away with an approximate solution: > cell width = length(cell value expressed as a string) * width of a typical > character in the cell's font. If we wanted to make this work for mixed-font (RichText) cells, perform the same computation on each run of characters that have the same font size and font name. A cheaper version is to assume all fonts have the same character widths. > cell width = sum of [(font size)*(average character width at 1pt font > size)*(number of characters in a same-size font run)] for each font run. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
