cancel
Showing results for 
Search instead for 
Did you mean: 

Reading/Writing .xlsx files using Webdynpro for Java

Former Member
0 Kudos

Dear All

I have a requirement to read/write excel files in .xlsx format. I am good in doing it with .xls format using jxl.jar. The jxl.jar doesn't support .xlsx format. Kindly help me in understanding how do I need to proceed on reading/writing .xlsx files using Webdynpro for Java.

Thanks and Regards

Ramamoorthy D

Accepted Solutions (1)

Accepted Solutions (1)

former_member185086
Active Contributor
0 Kudos

Hi

java.lang.Iterator Its a general class . or Explain clearly.

BR

'Satish Kumar

Former Member
0 Kudos

Hi Satish

As soon as I use the XSSFWorkBook class I get java.lang.Iterator error. I don't know what wrong I do in the classpath.

Thanks

Ramamoorthy D

Former Member
0 Kudos

Hi Experts,

This is what I get when I try to use XSSFWorkbook in the webdynpro code.

Kind Status Priority Description Resource In Folder Location

Error The project was not built since its classpath is incomplete. Cannot find the class file for java.lang.Iterable. Fix the classpath then try rebuilding this project. PD1_PORTAL_Dsignauthui~wrigley.com

Kind Status Priority Description Resource In Folder Location

Error This compilation unit indirectly references the missing type java.lang.Iterable (typically some required class file is referencing a type outside the classpath) SignAuthComp.java PD1_PORTAL_Dsignauthui~wrigley.com/gen_wdp/packages/com/wwy/signauth line 0

Thanks

Please help me out in getting an answer to resolve this issue

Regards

Ramamoorthy D

Former Member
0 Kudos

Hi,

You are probably using a late version of POI which is Java5+ and trying to deploy under a 1.4 JDK.

What version of EP / WDP are you running?

Regards,

Daniel

Former Member
0 Kudos

Thanks for reply

You are right I do use JDK 1.4 and using POI 3.5. What API I can use having Java 1.4 in my system and server?

Thanks

Ramamoorthy D

Former Member
0 Kudos

Hi,

You still can use POI. You only need an older version of it. 3.2 Final should be OK to work with 1.4

Download link below:

http://archive.apache.org/dist/poi/release/bin/poi-bin-3.2-FINAL-20081019.zip

Regards,

Daniel

Former Member
0 Kudos

Thanks for the link.

I will try this out and let you know.

Regards

Ramamoorthy D

Former Member
0 Kudos

Hi

The given POI 3.2 link doesn't seems to be working. Will try to get it. If you get some time please review it.

Thanks a ton!

Regards

Ramamoorthy D

Former Member
0 Kudos

The link is working. What do you mean?

Former Member
0 Kudos

Hi

The Link given by you for POI 3.2 download doesn't seems to be downloading the full 12 MB zip. It discontinues with 4 MB itself, this is what I mean.

Thanks

Ramamoorthy D

Former Member
0 Kudos

Hi,

If it's not your network, than the file should be corrupted. You can always try the downloading the source, using a different mirror, or download a jar file only.. whatever.

What I think it's important you to know, and what you should be more concerned, I don't think you can "write or read" XLSX files using a lower version than POI 3.5. And as you know, POI 3.5 is Java5+.

I'd suggest you go to POI website and read all the changelog.

Regards,

Daniel

Former Member
0 Kudos

Thanks, I''ll do the same...

Regards

Ramamoorthy D

Former Member
0 Kudos

Quick update,

You can use some download manager in order to have the download working. It seems the connection gets close after 4.7mb, but using a download manager (I've used a free one just for testing) I could complete the download.

Regards,

Daniel

Former Member
0 Kudos

Hi Daniel

I will do the way you said.

Thanks

Ramamoorthy D

Former Member
0 Kudos

Hi Danial,

Thanks a lot its really helpful to me .

I awarded your points. Thanks a lot.....

Answers (3)

Answers (3)

Former Member
0 Kudos

i am using jdk 1.6.22 and IBM WebSphere

when i use poi-3.6-20091214.jar and poi-ooxml-3.6-20091214.jar to read .xlsx file. but i am getting following errors

The project was not built since its classpath is incomplete. Cannot find the class

file for java.lang.Iterable. Fix the classpath then try rebuilding this project.

This compilation unit indirectly references the missing type java.lang.Iterable

(typically some required class file is referencing a type outside the classpath)

how can i resolve it

here is the code that i have used

public class HomeAction extends DispatchAction {

public ActionForward addpage(

ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws Exception {

String name = "C:/Documents and Settings/bharath/Desktop/Book1.xlsx";

FileInputStream fis = null;

try {

Object workbook = null;

fis = new FileInputStream(name);

XSSFWorkbook wb = new XSSFWorkbook(fis);

XSSFSheet sheet = (XSSFSheet) wb.getSheetAt(0);

Iterator rows = sheet.rowIterator();

int number=sheet.getLastRowNum();

System.out.println(" number of rows"+ number);

while (rows.hasNext())

{

XSSFRow row = ((XSSFRow) rows.next());

Iterator cells = row.cellIterator();

while(cells.hasNext())

{

XSSFCell cell = (XSSFCell) cells.next();

String Value=cell.getStringCellValue();

System.out.println(Value);

}

}

} catch (IOException e) {

e.printStackTrace();

} finally {

if (fis != null) {

fis.close();

}

}

return mapping.findForward("returnjsp");

}

}

Former Member
0 Kudos

Hope any one who would like to under stand APIs for XLS will get some clue from this Forum.

former_member185086
Active Contributor
0 Kudos

Hi

[Have a look on this thread|;

I am not sure but you can try [Apache POI|http://poi.apache.org/] and [this|http://poi.apache.org/spreadsheet/index.html]

Hope this information help you.

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi Experts

I tried using the POI API to get .xlsx working. The problem here is it shows something like I access outside the class path java.lang.Iterator not being found. Kindly help.

Thank you

Best Regards

Ramamoorthy D