jxl.read.biff.BiffException: Unable to recognize OLE stream
2005. 12. 1 ?? 2:28
hi,
I am trying to dynami ally generate Excel sheet using Java code.
Wht I did was I generated the numbers in NOTEPAD and rename it with .xls.
Now when I am trying to read the .xls file using JExcelApi..
I am getting the following error
jxl.read.biff.BiffException: Unable to recognize OLE stream
Can any one tell me what should I do..to over come it.....
If I have to read the filr from Notepad it self.
Vijay
Re: jxl.read.biff.BiffException: Unable to recognize OLE stream
2006. 6. 13 ?? 6:11 (reply 1 of 1)
the file that you create isn't in excel format, you can generate the numbers in notepad, separated by comas (,) and save the file as comma separated values (.csv) and open this file with excel and save as theNameWhatYouWant.xls (select the format in de combo box)
Re: jxl.read.biff.BiffException: Unable to recognize OLE stream
2008. 6. 12 ?? 3:23 (reply 2 of 3) (In reply to #1 )
Hi ,,
I am also getting the same error message ..
What i have done is i have read a xls file from the browser and write it to a specific location and then trying to read it by
Workbook but it is giving me this error............The below is the part of my code
ServletInputStream in = request.getInputStream();
byte[] line = newbyte[512];
int i = in.readLine(line, 0, 512);
int boundaryLength = i - 2;
String boundary = new String(line, 0, boundaryLength);
while (i != -1) {
String newLine = new String(line, 0, i);
if (newLine.startsWith("Content-Disposition: form-data; name=\"")) {
//Some more lines
//this is the file content
i = in.readLine(line, 0, 512);
i = in.readLine(line, 0, 512);
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
newLine = new String(line, 0, i);
while (i != -1 && !newLine.startsWith(boundary)) {
buffer.write(line, 0, i);
i = in.readLine(line, 0, 512);
newLine = new String(line, 0, i);
}
// save the uploaded file
RandomAccessFile f = new RandomAccessFile(savePath + filename, "rw");
byte[] bytes = buffer.toByteArray();
f.write(bytes, 0, bytes.length - 2);
f.close();
}
}
i = in.readLine(line, 0, 512);
} // end while
Uploadfilepath = savePath + filename;
WorkbookSettings ws = new WorkbookSettings();
Workbook workbook = Workbook.getWorkbook(new java.io.File(savePath+"\\" + filename),ws);//Here the error is