• 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

convert excel

 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java -Xmx xxxm -Xms xxxm adjust memory
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"wonder qi",
Please check your private messages.
-Ben
 
phani kon
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about open office? Could please anyone post some examples of open office
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that, here is the more clear code
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic