matxhe / excellibrary

Exported from code.google.com/p/excellibrary
0 stars 0 forks source link

Corruption occurs when number of rows exceed some length #115

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The resulting output is corrupt for data approaching 30 rows or more.

The following c# code will produce a corrupt resulting file:

Workbook wb = new Workbook();
Worksheet ws = new Worksheet("test");
string tempFile = Path.GetTempFileName();
for (int i = 0; i < 30; i++)
{
    ws.Cells[i, 0] = new Cell("hello");
}
wb.Worksheets.Add(ws);
wb.Save(tempFile); 

Whereas the following will produce a usable file (notice only 25 rows are 
produced in this case):

Workbook wb = new Workbook();
Worksheet ws = new Worksheet("test");
string tempFile = Path.GetTempFileName();
for (int i = 0; i < 25; i++)
{
    ws.Cells[i, 0] = new Cell("hello");
}
wb.Worksheets.Add(ws);
wb.Save(tempFile);  

Original issue reported on code.google.com by ssewell on 15 Nov 2011 at 9:45