Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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
Posts: 20822
68
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.
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!