File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes jxls problem reading file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "jxls problem reading file." Watch "jxls problem reading file." New topic
Author

jxls problem reading file.

Rubens Ballabio
Greenhorn

Joined: Oct 27, 2008
Posts: 2
Hi!

I've some issues reading a simple xls file containigs 4 columns (below an exaple)

tit1tit2tit3tit4
a1b1c1d1
a2b2c2d2
a3b3c3d3

i've created my xml template to read xls file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<workbook>
<worksheet>
<section startRow="0" endRow="1"/>
<loop startRow="1" endRow="1" items="sedi" var="sede" varType="it.reply.sem.utils.Sede">
<section startRow="1" endRow="1">
<mapping row="1" col="0">sede.a</mapping>
<mapping row="1" col="1">sede.b</mapping>
<mapping row="1" col="3">sede.c</mapping>
<mapping row="1" col="4">sede.d</mapping>
</section>
<loopbreakcondition>
<rowcheck offset="0">
<cellcheck offset="0">END</cellcheck>
</rowcheck>
</loopbreakcondition>
</loop>
</worksheet>
</workbook>

i've created Object "Sede" which contains 4 variables (a,b,c,d)

I use this code to read xls :



I have no errors, but my arraylist is empty.

someone can help me?

Thanks
[ October 27, 2008: Message edited by: Rubens Ballabio ]
Rubens Ballabio
Greenhorn

Joined: Oct 27, 2008
Posts: 2
ok
i've fixed it!!

Error was in xml template.
it seems that tag worksheet needs attribute name

so, correct xml template is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<workbook>
<worksheet name="Sheet1">
<section startRow="0" endRow="1"/>
<loop startRow="1" endRow="1" items="sedi" var="sede" varType="it.reply.sem.utils.Sede">
<section startRow="1" endRow="1">
<mapping row="1" col="0">sede.a</mapping>
<mapping row="1" col="1">sede.b</mapping>
<mapping row="1" col="3">sede.c</mapping>
<mapping row="1" col="4">sede.d</mapping>
</section>
<loopbreakcondition>
<rowcheck offset="0">
<cellcheck offset="0">END</cellcheck>
</rowcheck>
</loopbreakcondition>
</loop>
</worksheet>
</workbook>
Yasmeen MohdRafi
Greenhorn

Joined: Nov 27, 2008
Posts: 2
Hi,

I am a novice, interested in creating a bean from xls file.
From your post, i am unable to figure out what is sediloader?
Could you please let me know as to what does this class have.

Thank You
 
jQuery in Action, 2nd edition
 
subject: jxls problem reading file.
 
Similar Threads
Determining whether a queen can attack another piece
POI api to read MSExcel sheet
jxls problem
Read excel file using jXls
Help in jxls reader