Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Book Image

JDBC 4.0 and Oracle JDeveloper for J2EE Development

Overview of this book

Table of Contents (20 chapters)
JDBC 4.0 and Oracle JDeveloper for J2EE Development
Credits
About the Author
About the Reviewer
Preface

Chapter 13. Creating a Spreadsheet with Apache POI

Database table data is often required to be presented as an Excel spreadsheet. The Apache POI project provides Java APIs for processing Microsoft OLE 2 Compound Document Format Files, which include XLS and DOC files. The Apache POI HSSF component of the Apache POI project is a Java API to access and generate Excel Workbooks and Excel spreadsheets. Apache POI HSSF does not support the new Excel 2007 .xlsx OOXML file format, which is not OLE2 based. An Excel workbook consists of spreadsheets and an Excel spreadsheet consists of rows and cells. The layout and fonts of a spreadsheet are also set with the Apache POI HSSF Java API.

The Apache POI HSSF project is a Java API to create an Excel workbook and an Excel spreadsheet. The implementation of the Apache POI HSSF project is provided in the org.apache.poi.hssf.usermodel package. The data in the Excel spreadsheet generated with the POI HSSF project may be static data, or dynamically retrieved...