Forum > FPSpreadsheet

Text truncated over 255 chars [SOLVED]

(1/2) > >>

totya:
Hi!

Thanks for this great component, but I found a problem.

Simple open/save or CopyCell (in worksheet or between worksheets) result truncated text over 255 chars.

See attached sample.

Thanks!

wp:
The copied cell is written to the file in full length. Open the saved file in LibreOffice calc or Spready to verify (you'll have to increase the row height to see everything). So, the problem is that the text is truncated when the file is read by Excel!

The text in cell (0, 0) is in a "LabelSST" record, this means that the text is stored in the SST ("shared strings table") and the cell contains only the index of the text within the SST. These records were introduced with the BIFF8 format.

fpspreadsheet, on the other hand, writes text in the old "Label" records used in the previous versions. The old versions had reserved 1 byte for the string length; therefore, Excel 5 and earlier must truncate at 255 characters. I did not expect that BIFF8 does the same because Microsoft has extended the length information to two bytes.

I'll try to introduce a Shared-String-Table in the implementation of BIFF8 for fpspreadsheet. Let's see what happens.

totya:
Hi master!

Thanks for the answer! I worked my real job file, and I see, some long texts are truncated, so I think this is important problem. In my job we uses Office XP version (BIFF8).

If I open sample_out.xls from Office 2007, the text truncated already. If I open it from Spready it seems to me it is okay.

Thank you! ...and I hope the new version will arrive soon... :)

wp:
Done finally... The Excel8 writer of fpspreadsheet r6054 now writes strings to a shared-string-table (SST) and this overcomes the 255-character-limit. It was quite mind-twisting to get this working along with rich-text formatting runs because a BIFF record is limited to 8224 bytes; therefore CONTINUE records had to be added if this is not enough, which is very likely in case of the SST which collects all strings of the worksheet; and correspondingly, strings and formatting runs have to be split correctly at the cross-over.

Please test carefully. I think that the most critical border cases are covered by the tests included with fpspreadsheet, but you never can tell...

totya:
Thanks master, thank you for your job, it seems to me it's working!

Navigation

[0] Message Index

[#] Next page

Go to full version