aspose file tools*
The moose likes Other Open Source Projects and the fly likes writing into excel sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "writing into excel sheet" Watch "writing into excel sheet" New topic
Author

writing into excel sheet

ranjan manohar
Greenhorn

Joined: Dec 11, 2008
Posts: 18
Hi all,

My requirement is I have to write the Data into a Microsoft excel sheet. That I was able to do. But now my problem is, I have new requirement of writing into same excel sheet for whole month. I mean my program has to create a new excel sheet every month starting and should write all data into same excel till that month end. Even my program runs repetitively for every 30min in a day. I have attached my program here below which will write into excel sheet. Can anyone suggest me the modification which satisfies my requirement.

Thanks in advance,
Ranjan



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
Currently the code uses only a single sheet. You'll have to add new ones for each month: http://poi.apache.org/spreadsheet/quick-guide.html#NewSheet You may want to give the sheets meaningful names, maybe the month names, or a number from 1 to 12.


Ping & DNS - updated with new look and Ping home screen widget
ranjan manohar
Greenhorn

Joined: Dec 11, 2008
Posts: 18
That part is okay… but how can I write into same sheet again and again, because my program will run for every 30 min. How can write all the values into the same sheet in a span of one month. Please suggest some solution. Should I have to do some modification in constructor?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
I'm not sure I fully understand the question, but you can get references to existing sheets using the HSSFWorkbook.getSheet(String) and HSSFWorkbook.getSheetAt(int) methods.
ranjan manohar
Greenhorn

Joined: Dec 11, 2008
Posts: 18
Thanks a lot...
Bijj shar
Greenhorn

Joined: Mar 11, 2009
Posts: 13
Actually procedure should be save all data in data base and generate monthly report in xls sheet format. I don’t understand why all data writing requirement in same xls sheet in every 30 minute. I could think simple scenario if machine crashes or xls modified or deleted where will find the backup data means all data will be lost.

Don’t mind if you are not agree…
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing into excel sheet
 
Similar Threads
root cause of problem ,why 2003 excel cell background color is not reflecting in orginal document
facing diffculty to highlight background color of an excel cell which is not reflected in file
opening the excel sheet from servlet
How to make POI HSSF support Chinese Encoding?
How to connect to Open Office Database using JDBC connection in Java