• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jxls problem reading file.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic