We Recommend

Java How to Program Java How to Program
Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more.


Posted By

indianocean on 04/10/08


Tagged

java servlet poi


Versions (?)


Simply write an Excel file from POI to the file system


Published in: Java 


  1. InputStream inputStream = getClass().getClassLoader().getResourceAsStream("templates/template_report.xls");
  2. POIFSFileSystem fileSystem = new POIFSFileSystem(inputStream);
  3. HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
  4. FileOutputStream out = new FileOutputStream("workbook.xls");
  5. workBook.write(out);
  6. out.close();
  7. inputStream.close();

Report this snippet 

You need to login to post a comment.