Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exception when using jxl library

807605Oct 12 2006 — edited Jun 27 2007
hii all,

am trying to read data from an excel sheet using java code.
this is my class i have written:

import java.io.File;
import java.io.*;
import jxl.*;
import java.util.*;
import jxl.Workbook;
import jxl.read.biff.*;

class readXls
{
public static void main(String[] args)
{
try
{
String filename = "input.ods";
WorkbookSettings ws = new WorkbookSettings();
ws.setLocale(new Locale("en", "EN"));

Workbook workbook = Workbook.getWorkbook(new File(filename),ws);

Sheet s = workbook.getSheet(0);

readDataSheet(s);
workbook.close();
}
catch (IOException e)
{
e.printStackTrace();
}
catch (BiffException e)
{
e.printStackTrace();
}

}

private static void readDataSheet(Sheet s)
{
Cell lc = s.getCell(1, 1);
System.out.println("****************" + lc.getContents()+"****************");
}

}


when running this program i got the following exception:

jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:111)
at jxl.read.biff.File.<init>(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:210)
at readXls.main(test.java:18)


please help.
Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2007
Added on Oct 12 2006
11 comments
1,602 views