Using Apache POI With Protected Excel Files

Jonny Hackett Development Technology, Java, Spring Batch 1 Comment

While working on a recent project at a client, we had the opportunity to refactor some data extracts that were using a commercial Excel writing library, which we then converted to using the Apache POI Library for Excel. These data extracts were reports that included some calculated values, and depending on the client, were required to be password protected. When completed, the reports would be emailed to the recipients configured for each client.

In this post, we discuss the challenge of delivering protected Microsoft documents via email. We introduce a Java code solution for emailing password-protected Excel files when using the Apache POI Library.

Some of the required calculations we chose to implement using Excel formulas. Implementing formulas wasn’t a hard task and worked for what was needed.

Reading and Writing from Excel in Spring Batch

Rik Scarborough Development Technology, Java, Spring, Spring Batch, 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

Attention: The following article was published over 4 years ago, and the information provided may be aged or outdated. Please keep that in mind as you read the post.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 …

Using Handsontable Inside jQuery Tabbed Dialogs

John Boardman Development Technology, JavaScript, Tutorial Leave a Comment

Attention: The following article was published over 6 years ago, and the information provided may be aged or outdated. Please keep that in mind as you read the post.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, …

Generating Large Excel Files Using Spring Batch, Part Three

Jonny Hackett Development Technology, Intro to Spring Batch Series, Java, Spring, Spring Batch 14 Comments

Attention: The following article was published over 8 years ago, and the information provided may be aged or outdated. Please keep that in mind as you read the post.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. …