From: <sud...@co...> - 2008-08-12 15:44:34
|
Leo, I deleted my template and created a new template from the scratch as you had suggested and it did work fine. Thank you very much for your help. I think the template that I copied and modified earlier must be older version of excel which was giving me the NumberFormat exception. Thanks Sudhish -------------- Original message -------------- From: Leo <le...@gm...> > Hi, > > Possibly something is wrong with your template. > > Try to start from scratch, create new Excel document and see if it works. > > If it is not send me your simple sample so I can take a look. > > Monday, August 11, 2008, 7:30:41 PM, you wrote: > > > Hi, > > > > I am trying to use the multiple sheets feature provided by the > > jxls with a very simple example provided in jxls web site. I am > > trying to display each department name into a sheet and then display > > all departmets names into each sheet. > > > > I can do this using poi libraries but get Number Format Exception > > while executing below statement in jxls. > > > > HSSFWorkbook xsl = transformer.transformMultipleSheetsList(is, > > getDepartments(), sheetNames, "department", new HashMap(), 0); > > > > 1. is: is a InputStream where I am reading my template from > > 2. getDepartments() : public ArrayList getDepartments(){ > > Department depIT = new Department("IT"); > > Department depHR = new Department("HR"); > > ArrayList departments = new ArrayList(); > > departments.add(depIT); > > departments.add(depHR); > > return departments; > > } > > 3. sheetNames: is an ArralyList with department names in it. > > 4. "department" : is the string that I am using in my excel > > template to represent a department name (for Expample, > > ${deaprtment.name} ) > > > > I even tried putting each department in to a map and supplying an > > ArrayList of maps for second variable. > > > > I get the following exception: > > Exception thrown > > from AjaxHttpServletMultipleSheets > > Reports:java.lang.NumberFormatException: 6$7 > > java.lang.NumberFormatException: 6$7 > > at > > java.lang.Integer.parseInt(Ljava/lang/String;I)I(Unknown Source) > > at > > java.lang.Integer.parseInt(Ljava/lang/String;)I(Unknown Source) > > at > > org.apache.poi.hssf.util.CellReference.(Ljava/lang/String;)V(Ce > > llReference.java:67) > > at > > org.apache.poi.hssf.util.AreaReference.(Ljava/lang/String;)V(Ar > > eaReference.java:66) > > > > Looks like it is coming from the poi's CellReference class and I > > tried to look it up in poi mailing list. > > This particular bug was fixed long time ago and I am using their latest jars. > > > > Here are the jxls and poi jars that I am currently using apart from the other > required jars: > > jxls-core-0.9.6.jar > > jxls-reader-0.9.6.jar > > poi-3.1-FINAL-20080629.jar > > poi-contrib-3.1-FINAL-20080629.jar > > poi-scratchpad-3.1-FINAL-20080629.jar > > > > Do you think that it is due to poi or something that I am doing wrong while > implementing jxls. > > Appreciate any kind of help. > > > > Thnaks > > Sudhish > > > > |