Reading and Writing from Excel in Spring Batch

Rik Scarborough Java, Spring, Spring Batch, Technology Snapshot, Tutorial Leave a Comment

We have discussed many different ways to read and write data in Spring Batch. The framework comes with quite an assortment of Readers and Writers that can be used directly or reused in some manner. Most of the time, the requirements consist of reading the data from some type of text file or database.

So what happens when the business we are supporting asks for something out of the ordinary, such as reading an Excel file and outputting the data to another Excel file? Typically the off-the-cuff response would be, “can you convert it to a CSV or other delimited text file?” Or “You know, Excel will read a CSV file just fine.” Sometimes that works, and sometimes the business requirements do not allow that type of flexibility.

Consider this scenario; in these days of Cloud and other online computing, the input file is likely created by a server that the company has no direct access to as far as programming. The file it creates is in one format, Excel. The output of your process has to go before several executives or other business clients and needs to be formatted in a professional looking manner. Adding a manual process to import a CSV and format it diminishes the value of using Spring Batch.

For the sake of the honor of the coding profession, you agree to the requirement to read and write from an Excel file directly. Now, how do you do that?…

Spring Batch: Multiple Format Output Writer

Jonny Hackett Java, Spring, Spring Batch 1 Comment

Being a strong advocate of Spring Batch, I’ve always talked about the notion of Spring Batch providing developers with a framework that allows them to focus on solving business needs. By doing so, it allows developers to not spend an inordinate amount of time solving all of the technical aspects to support the solution. To illustrate what I mean by …

Using Handsontable Inside jQuery Tabbed Dialogs

John Boardman JavaScript, Technology Snapshot, Tutorial Leave a Comment

Update 12-9-2014  – See the end of the article for the PHP/Server Side code! Handsontable is a minimalistic Excel-like data grid editor for HTML, JavaScript & jQuery. I came across it while looking for a ready-made, easy-to-use, and small data editor for implementing a client requirement involving loading, editing, and saving reference data inside an SPA (single page application). Handsontable met all of my requirements and more. …

Generating Large Excel Files Using Spring Batch, Part Three

Jonny Hackett Java, Spring, Spring Batch, Technology Snapshot 13 Comments

While working for a client recently, I was given a small project to produce a report that would help reconcile differences in data that existed in four to five different database sources. The requirements specified a need to compare roughly 40 fields from each of these sources against each other, and to report the differences in MS Excel format, which …