wiln / as3xls

Automatically exported from code.google.com/p/as3xls
0 stars 0 forks source link

ExcelFile have no currentSheet #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new ExcelFile
2. Save it to disk
3. reload it 

What is the expected output? What do you see instead?
when i reload a file create with the saveToByteArray, i have this issue : 
warning: unable to bind to property 'sheets' on class
'libs.as3xls.xls::ExcelFile'
the current sheet on the line 602 of the Excelfile class is a null reference

Please use labels and text to provide additional information.

i create the ExcelFile like this : 
var f:File = new File();
var fs:FileStream = new FileStream();

// Set up the Excel sheet and size it appropriately
var s:Sheet = new Sheet();
s.resize(10, 10);

// Loop over the input array and set each cell to the appropriate value
for(var r:uint = 0; r < s.rows; r++) {
    for(var c:uint = 0; c < s.cols; c++) {
        s.setCell(r,c,"test");
    }
}

// Wrap the sheet in an Excel file and write it to disk
var xls:ExcelFile = new ExcelFile();
xls.sheets.addItem(s);
var ba:ByteArray = xls.saveToByteArray();

f.nativePath = path+"/dotation.xls";
fs.open(f, FileMode.WRITE);
fs.writeBytes(ba);
fs.close();

Original issue reported on code.google.com by vedde...@gmail.com on 12 Mar 2010 at 3:23