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 convert excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "convert excel" Watch "convert excel" New topic
Author

convert excel

phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
I have a very large excel file(3,245kb), so I can't open from java. It is giving out of memory error. So how would I do it. Do I have to convert into another format. If I convert to another format. Is java can read that format?

Please let me know the solution?

Thanks a lot
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It depends on what you're trying to do. Do you need to understand the data?
You could always convert to CSV, as that is just text, but again we come back to what you need to accomplish
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
(Continued from here.)

Some links regarding the OpenOffice Java API can be found in the http://faq.javaranch.com/java/AccessingFileFormats page.

How is it possible if I open same excel into (because of the memory issue) htm and data should be added from the database on the htm ? Later I convert into excel inside the code to generate corresponding graphs or charts and open again as a htm page.

I'm not sure what you're proposing to do. Excel files are not HTML, and can't meaningfully be converted into HTML without losing a lot of features. As David says, it depends on what exactly you need to do, and I don't have a good idea what that is.


Ping & DNS - my free Android networking tools app
wonder qi
Greenhorn

Joined: Sep 27, 2006
Posts: 2
java -Xmx xxxm -Xms xxxm adjust memory
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"wonder qi",
Please check your private messages.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Here is my requirment. I am trying to open and read the excel file(3.245mb) from the browser, but I couldn't open because of some memory issue.The excel file contains charts and graphs also.

What are the other options to open and read the excel file?

I need to generate charts and graphs also. It is really very complicated issue, I don't understand, how to resolve this isssue.

I need some to help me please

thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
It seems we're going around in circles. Have you tried jExcelApi? Have you tried the OpenOffice java API? Have you tried increasing the available memory? All these might solve the issue.
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
The file is 3.245m.After adding the data it can be more than this 3.245m.I have increased the jvm like below. But It didn't help.

1.
-showsplash
com.genuitec.myeclipse.product
--launcher.XXMaxPermSize
256m
-vmargs
-Xms6m//modified
-Xmx80m//modified
-Dosgi.splashLocation=C:\eclipse\eclipse\MyEclipseSplash.bmp
-Duser.language=en
-XX p ermSize=128M
-XX MaxPermSize=256M

2.Suppose If I remove charts and graphs form my existing excel file inorder to decrease the memory size. How can reproduce using java code on excel again. Also I don't see any thing to build charts and graphs uisng JEXCEL.

3.Is open office is software tool to convert xsl to anyother format.I need to dowonload the software or any jar will be there. Suppose If I convert Using OpenOffice to.sxc format. How would I read from java.Do you have any examples. The site you specified does not have any examples using java.

Please let me know. If I need to try anything else.

Any ideas or suggestions would be really helpful

thanks
[ March 19, 2008: Message edited by: lakshmi manepally ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
80MB for the max heap size isn't much, especially if these are the options for Eclipse (and it looks to me like they are), because in that case a big chunk of the memory will be used up by Eclipse. Try running the code as a standalone program -in other words, outside of Eclipse- and allocate a max of 128MB to it. I'd be surprised if that wasn't enough memory to work with.
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
What about open office? Could please anyone post some examples of open office
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
The page I mentioned before contains relevant links, e.g. one called "this article" that contains example Java code. Now, that article talks about word processing documents, but the general approach should be similar for spreadsheets. (That article also shows that the API has a steep learning curve; I wouldn't use it unless I had exhaustively researched other approaches.)

The page also links to the OO developer site, and to the JODConverter project which may be helpful to you.
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
Thanks for your information. I have one question,Using Jexcel how do we update the columns in the excel from the database.

I mean If I want to update say column name "2008 q1" values.That value should directly come from database (resultset).

Can you post me one similar example

Thanks
[ March 19, 2008: Message edited by: lakshmi manepally ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
Didn't we have this discussion already recently? The tutorial shows how to read, modify and write files - what else are you looking for?
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
It doesn't show anything like update data from the ResultSet. I am looking like below.

How do I connect using Jexcel to the resultset.

rs resultset = st.excutequery("select * form XXXX);

I hope you understand my question.

Thanks a lot.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

What does your code look like? (it's clear you didn't copy and paste that line)
Maybe there is an error, and you're gobbling it up.
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
I want to read the file and update values through resultset in the excel using JExcel. Can you tell me,How can I do it.here the sample code

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
I'm not following. This code doesn't contain anything JDBC-related, so how are you using a database? Do you intend to get values from a database, and store those in an XLS file, or the other way around?

(Just in case you're unclear about that: Excel files are not databases, so you can't use JDBC to read from them or write to them. That's why there are APIs like POI and jExcelAPI.)
phani kon
Ranch Hand

Joined: Apr 06, 2005
Posts: 251
I know that, here is the more clear code
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert excel