Friday, November 2, 2018

Spring RESTful Web service to generate downloadable Excel as response using JExcel API and Apache POI

JExcelApi is a Java library that is dedicated for reading, writing and modifying Excel spreadsheets. It supports Excel 2003 file format and older versions. You can download JExcelApi from the following link:

To work with JExcelApi, you need to add its only jar file: jxl.jar - to your project’s classpath. Download JExcel

Here we are going to create spring API to download Excel file as response using JExcel Api.

Now call the service as :
This will download the Excel file to download folder or show download popup window.

Create Excel using Apache POI

POI-XSSF - Java API To Access Microsoft Excel Format Files
Apache POI is a popular API that allows programmers to create, modify, and display MS Office files using Java programs.
XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format.

· DK1.5 or later versions
· Apache POlibrary ( )

Add following library to classpath:

Read / Write Excel file (.xls or .xlsx) using Apache POI : Full Example



Post a Comment


Get in touch with me


Bangalore, India