We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

non sparse data?!

My task was to obtain an overall worksheet format/color from an XLS file to preset ours before importing. Not knowing where to get this (the default may not be it, if the user selected the whole sheet and chose a different font, as an example), I decided upon the far bottom right corner (worksheet.Range[65536,256]) as a probable unused that would indicate a better guess for the overall sheet formatting. After requesting this range and fetching its properties, a foreach loop through the worksheet.Cells collection fried. The ultra small test file I used claimed a Cells collection of 6, so I changed my Range request to Range[10,10] and lo and behold, the worksheet.Cells collection claimed 100 cells! Oh my gosh! So requesting the far bottom right causes an instantiation of 65536*256 cells?! (or worse, 65536^2) Aweful! For now, my workaround is to fetch the last cell in the collection, and use its row and its cell+1 (which causes my cell collection to increase, but not by as much) for the Range of the unknown cell that I will fetch CellStyle information from. I look forward to an explanation, as it seems that XLSIO will only be able to handle small sheets, and can''t even handle small ones if a single cell is far away. -Greg

2 Replies

AD Administrator Syncfusion Team December 22, 2005 02:51 PM UTC

Hi Greg, I will investigate into this issue and post an update soon. Thanks, Stephen.


AD Administrator Syncfusion Team January 13, 2006 02:48 PM UTC

Hi Greg, Sorry for the delay in getting back to you. 1) Your original problem of having to get the default styles that are used in a worksheet would be possible as soon as this feature is implemented http://www.syncfusion.com/support/features/xlsio/Default.aspx?ToDo=view&questId=684 When a user uses Select All in excel and changes some formatting, the default column styles of columns 1-256 are assigned a default style so once this feature is implemented you would be able to read the default style by reading the default column style. 2) I investigated this issue and found that you were correct in saying that XlsIO has a problem working with sparse data and there seems to be no way to enumerate through the collection of used cells in a worksheet. I have notified the development team and we will address this issue with the highest priority. Thanks for reporting this issue. Best regards, Stephen.

Loader.
Live Chat Icon For mobile
Up arrow icon