Monday, May 9, 2016

Easily Provide Excel Reports with Rails and jXLS

Reporting is one the most important requirements in any application and, if we are dealing with a business application, the requirements can take on even more importance. However, providing on-screen reports or pretty HTML or PDF reports doesn't always satisfy the user. Sometimes users require Excel reports so that they can work further on the data to get exactly the results they want.

Ruby fortunately provides many Excel related libraries, but most of them use programmatic way to create Excel, which can quickly get complicated and tiresome for the more complex reports. But we have a solution for that: jXLS. It's a popular Java library used to generate Excel files from template Excel files. Thanks to JRuby we can use this excellent library in Rails. Without further ado let's get started.

Creating a Basic Rails Application

We will create a basic Rails application with an Invoice model and CRUD actions. The application will use JRuby, Rails 4.2, and SQLite to keep things simple. First of all, install JRuby with RVM or rbenv.

Continue reading %Easily Provide Excel Reports with Rails and jXLS%


by Devdatta Kane via SitePoint

No comments:

Post a Comment