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

problem with a large xls file and cell validation

I generate with Syncfusion XlsIO an xls file which has around 24000 rows. Some of the cells have the following validation put on them:

rng.Number = Convert.ToDouble(p) / 100.0;
rng.NumberFormat = "0.0000%";
rng.DataValidation.AllowType = ExcelDataType.Decimal;
rng.DataValidation.CompareOperator = ExcelDataValidationComparisonOperator.GreaterOrEqual;
rng.DataValidation.FirstFormula = "0";
rng.DataValidation.ErrorStyle = ExcelErrorStyle.Stop;
rng.DataValidation.ShowErrorBox = true;
rng.DataValidation.ErrorBoxText = "this must be a valid decimal number.";

MS Excel cannot correctly open the generated file (which is around 3.3 MB). It gives
"Excel found unreadable content in file. Do you want to recover the contents of this workbook?"
and recovery doesn't restore the file.

Opening the file with XlsIO results in the following exception:
-> Length or offset has wrong value.
Nazwa parametru: length & offset
Syncfusion.XlsIO.Base
w Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRawWithArray.CheckOffsetAndLength(Int32 offset, Int32 length)

Now, if I comment out all "DataValidation" lines, the generated file (around 3.2 MB) is okay.

Another case: I split the file into a few smaller ones which means having around 3000 rows (weighing around 400 KB) and keep validation in place. Then the smaller files are perfectly okay.

It looks as if XlsIO can't write correctly large XLS files. Has anyone experienced something like that or know how to fix?

1 Reply

MR Mahajothi R Syncfusion Team August 30, 2012 01:24 PM UTC

Hi Artur,

 

Please follow the below incident for the reported issue.

 

Incident link : http://www.syncfusion.com/support/directtrac/detailsupdate/55793

 

Please let us know if you require any further clarifications.

 

Regards,

Mahajothi.


Loader.
Live Chat Icon For mobile
Up arrow icon