Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write a file to a directory

 
Ashok Deivasigamani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys I had created a xls file in java using the Java Excel API in my java code,
I don't know how to write the file to a directory location in my computer, so that I can open the file and see the actual content of the xls file that I have created using the follwing code

WritableWorkbook workBook = Workbook.createWorkbook(new File("ExcelOut.xls"));

 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to call both workBook.write() and workBook.close() (in that order). Forgetting to call close() will still create a 0 byte file. Forgetting to call write() creates an invalid Excel file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic