I am using Axolot components for Excel export. I need to word-wrap some cells which may contain long strings. Applying the wrap property does not cause the component to resize the row height, however.

I am using Axolot components for Excel export. I need to word-wrap some cells which may contain long strings. Applying the wrap property does not cause the component to resize the row height, however. 

My own efforts to resolve the problem have been less than pleasing. As long as the (merged) target cell is fairly wide, and the number of rows needed is small, then I get the proper result. However, if the target cell is relatively narrow, then my height adjustment will be wrong. And what makes it very difficult to understand is that for two different cell widths in the same sheet, using the same string, one will be made higher than needed, by several text rows, and the other will be made not high enough, by a couple of rows.

I have considered getting the actual string width from a canvas, but the component is in a data module, so no canvas is available. 

Any thoughts?

Also on StackOverflow:  http://stackoverflow.com/questions/24679605/wrapping-text-in-export-to-excel

Comments

  1. Why don't you create an invisible temporary canvas for measuring?

    ReplyDelete
  2. I suppose I could. But this is exploratory, and the primary question is whether there is a way to get XLSReadWriteII4 to do the row height adjustment for me. Apparently it worked in XLSReadWriteII2, and there is a new property in XLSReadWriteII5, where it also works. But we will not be upgrading, so a fix, if one exists, is needed for XLSReadWriteII4.

    More specifically, if no one comes up with a potential solution using features in the component, then I will allocate time for experiments.

    ReplyDelete

Post a Comment