Extract full text from cells quickly

Hi,


Were extracting the cell contents using <span style=“background-color: rgb(43, 43, 43); color: rgb(169, 183, 198); font-family: “DejaVu Sans Mono”; font-size: 7.6pt;”>cell.getDisplayStringValue() which some times doesn’t return all the text in the cell if the column or row is too small. We have worked around this by ensuring that all cells do not have any rotation set and the rows and columns are fit to their contents.
<span style=“background-color: rgb(43, 43, 43); color: rgb(169, 183, 198); font-family: “DejaVu Sans Mono”; font-size: 7.6pt;”>worksheet.autoFitRows(fitterOptions);
<span style=“background-color: rgb(43, 43, 43); color: rgb(169, 183, 198); font-family: “DejaVu Sans Mono”; font-size: 7.6pt;”>worksheet.autoFitColumns(fitterOptions);
This is working, but can be very slow. The autoFit steps seem to take almost as long as extracting the text.



Is there any way we can get the text content with its number or text formatting applied, but avoid truncation if the cell is too small without the cost of auto fitting the entire sheet.

Can we set the column and row size to their maximum to achieve the same effect?

Nick

Hi,


Thanks for your query.

Well, we think you can set the column width to some value which should be approximately as wide enough to get the formatted results without truncations. For example, you can use Cells.setColumnWidth() method for all the columns from 0 to Cells.getMaxDataColumn() method as we think setColumnWidth method is much more faster than auto-fit function(s). Generally, you should determine some value in accordance with the contents of the file, such as, 50, 100, or else. Mind you, it is just an workaround with some sort of estimation/guess as per the contents in your workbook.

Hope, this helps a bit.

Thank you.

Thank you.


I have made the suggested changes and so far so good.

Hi,


Good to know that the suggested workaround figures out your issue. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.