wood burning stoves*
The moose likes I/O and Streams and the fly likes Writing a content in excel in incremental way Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Writing a content in excel in incremental way" Watch "Writing a content in excel in incremental way" New topic
Author

Writing a content in excel in incremental way

Vibhas Kumar
Greenhorn

Joined: Oct 13, 2009
Posts: 28
Hi friends i am facing one issue while writing the content in an excel sheet incrementally.When i try to add the next content in an existing excel sheet. I loose the previous one.Can any one help me to resolve this.Here is the code for this. I have created two java classes 1.ReadXLSheet -->to read the file 2.Create--> to write the content incrementally.

Kindly look into it and resolve this issue.



*************************************************************************



Thanks in advance
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

Please mind your language. I've removed the offensive word from the subject.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

Hi Kumar,

You'll probably get better responses if you post less, more targeted code samples, and more information about what you're doing and what's going wrong.

In this case, I haven't worked with the jxl.Workbook class, but I see you create a new one each time you call the write() method, and pass it (I assume) the same file as a parameter. When you later call workbook.write(), I'm guessing it overwrites whatever was in the file with the new contents of the workbook. If that's not what you want to happen, you're going to have to go back to Workbook and see if it has another interface you can use.

Also, take a look at this code:


That's just confusing.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
The javadocs of Workbook.createWorkbook(File,WorkbookSettings) talk of "creating" a file - which doesn't sound as if it would preserve an existing one. One of the other createWorkbook methods may be more suitable.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing a content in excel in incremental way
 
Similar Threads
How to write a file to a directory
Please help for this Problem in creating excel sheet using java
importing data from database to excel sheet through JExcel Api
JExelApi read formulaNumberValue
File downloading issue with Tmcat 6.0