excel api

hi

i m using POI api for read the excel files to java..

when i m trying to read the excel files with large amount of data, which

have macros or freeze option it throws outofmemory error.

for outofmemory error i increased the heapsize memory..but no use....

here i gave the url below....i want any other api which is not in that below url....

http://schmidt.devlib.org/java/libraries-excel.html

[437 byte] By [vrkrajeshrajua] at [2007-11-27 10:53:19]
# 1

Hi, though it's in the list you cited. This resource successfully worked for me. I

have been experiencing a bug with POI that I switch to Java Excel by Andy

Khan.

http://www.andykhan.com/jexcelapi/

lem@phila at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 2

thanks .for ur suggestion...

but the Java Excel API can read the excel file upto 2000 only (I think so)..

is it possible it can read newer versions

vrkrajeshrajua at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 3

> thanks .for ur suggestion...

>

you're welcome

> but the Java Excel API can read the excel file upto

> 2000 only (I think so)..

>

Yes you're right.

>

> is it possible it can read newer versions

I'll check -

lem@phila at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 4

> when i m trying to read the excel files with large

> amount of data, which

> have macros or freeze option it throws outofmemory

> error.

>

> for outofmemory error i increased the heapsize

> memory..but no use....

>

> here i gave the url below....i want any other api

> which is not in that below url....

So using another API magically reduces 400 MB of Excel data to 20 MB? Wow.

Maybe you should rather re-think your working approach.

CeciNEstPasUnProgrammeura at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 5

thanks for ur answers..please try whether it can read newer versions

thanks once again

vrkrajeshrajua at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 6

hi lem i used the javaexcel API....

but i got outofmemory from this api also...

how can i avoid this error without increase heap size memory ?

can u tell me the solution

thanks

vrkrajeshrajua at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 7

> hi lem i used the javaexcel API....

>

> but i got outofmemory from this api also...

>

> how can i avoid this error without increase heap size

> memory ?

>

> can u tell me the solution

>

hi. Maybe your excel file size necessitates a larger heap memory. If your file is really large then your JVM also needs a large memory.

lem@phila at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 8

how big is your excel file?

lem@phila at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 9

Hi my excel file size is 6 MB...

If i increase heap size memory,,then the cpu takes hundread of usage...so the application goes to hang...

vrkrajeshrajua at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 10

> Hi my excel file size is 6 MB...

>

That's weird. I'm working with as large as 11mb, and have increased my

maximum heap memory size to 192mb, and it works

> If i increase heap size memory,,then the cpu takes

hundread of usage...so the application goes to hang...

Sorry, but I did'nt get this part. Please enlighten me. :)

lem@phila at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 11

The task manager tells the cpu usage...in taskmanager->performance tab-> The graph says 100 percent cpu usage....

vrkrajeshrajua at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 12

The task manager tells the cpu usage...in taskmanager->performance tab-> The graph says 100 percent cpu usage....we can check this performance when import excel file to java application........

thanks

vrkrajeshrajua at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 13

I switched from POI to JExcel too, and I don't regret it, but I've found it to be a couple of orders of magnitude slower.

I suggest you turn the JExcel garbage collection *off*. For some reason by default it calls System.gc() itself all over the place, which is just a complete waste of time. The JVM has much more of an idea about when GC is required than any application. You can turn it off in JExcel with a system property, or via the WorkbookSettings object.

ejpa at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 14

oh I see - maybe it's the macros and the freeze option. let me check it's

documentation.

lem@phila at 2007-7-29 11:43:20 > top of Java-index,Java Essentials,Java Programming...
# 15

ok thanks...i m also try

vrkrajeshrajua at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 16

hi again. I've already checked. It's supposed to preserve macros on copy - but is

not able to generate macros.

Is your program also manipulating and modifying the macros?

lem@phila at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 17

no my program is cant read or write macros....

vrkrajeshrajua at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 18

is your program very long?

can you post some of your relevant code here?

Please don't forget to enclose it with code tags. :)

lem@phila at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 19

will get back to you tomorrow :) i'm about to leave from work... check up on your code tomorrow

lem@phila at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 20

hi here the code

Workbook workbook = Workbook.getWorkbook(file);

Sheet sheet = workbook.getSheet(cmbSheets.getSelectedIndex());

The excel file will be in file...

The out of memory throws when the second line readches

thanks

vrkrajeshrajua at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 21

hi lem

here my code..

Workbook workbook = Workbook.getWorkbook(file);

Sheet sheet = workbook.getSheet(0);

The Excel file will be in file reference..

The out of memory throws when the execution comes next line..

Tell me any remedy for this issue...

or

when we "save As" an excel in csv format.....i can reduce the memory...

so i need how to convert an excel file into .csv format by java code

(note:CSV format means ".csv" format not comma separeted values)

vrkrajeshrajua at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 22

> (note:CSV format means ".csv" format not comma

> separeted values)

Uuuuhhmmm, ".csv" means Comma Separated Values, it's just that it does not need to be a comma that is used.

masijade.a at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 23

hi. good morning - what I did, which significantly reduced the file size, was

divide my "50,000+"-rows worksheet into several sheets - but I do not know if

that can be applied to solve your problem.

Hmmm... What was the maximum heap memory size you've set and tried?

lem@phila at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 24

hi lem very good morning

i m using netbeans 5.0 IDE..

-J-Xms32m -J-Xmx128m this is my heap size memory. in that...

but i dont want increase the heap size memory........

i have the second option...

that i want to convert the excel file into csv..

For example open an existing excel file..and using saveAs filename.csv format...

you will get a csv format file...

like that i want do this by java code...

can u please help me..

thanks for ur tech support...

vrkrajeshrajua at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 25

> hi lem very good morning

Good morning.

> i m using netbeans 5.0 IDE..

Good for you.

> -J-Xms32m -J-Xmx128m this is my heap size memory. in

> that...

>

> but i dont want increase the heap size

> memory........

Good, I agree. So don't.

> i have the second option...

> that i want to convert the excel file into csv..

Is this somehow related to the first option?

See Apache POI/HSSF, JExcel, and several other Java Excel packages that you can find with a Google search.

ejpa at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 26

> hi lem very good morning

>

Hi.

> i have the second option...

> that i want to convert the excel file into csv..

> For example open an existing excel file..and using

> saveAs filename.csv format...

It seems like a viable option... if you're only interested in reading values

> you will get a csv format file...

> like that i want do this by java code...

>

> can u please help me..

have no prior experience regarding this, but maybe others, or Google can

help - :)

> thanks for ur tech support...

you're welcome. still have not been much of a help.

lem@phila at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...
# 27

ok thanks i m trying..

vrkrajeshrajua at 2007-7-29 11:43:25 > top of Java-index,Java Essentials,Java Programming...