• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Writing a content in excel in incremental way

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please mind your language. I've removed the offensive word from the subject.
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic