This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 41148
    
  45
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 - my free Android networking tools app
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: 41148
    
  45
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…
 
jQuery in Action, 2nd edition
 
subject: writing into excel sheet
 
Similar Threads
How to connect to Open Office Database using JDBC connection in Java
opening the excel sheet from servlet
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
How to make POI HSSF support Chinese Encoding?