You have probably generated CSV files in your Rails applications based on some data. Those files can then be converted to Excel format in order to apply some styling, formatting, add graphs, etc. However, wouldn't it be more convenient to automate all these tasks and generate .xlsx files instead? With the axlsx gem created by Randy Morgan that it is totally possible!
This gem provides a huge list of features allowing you to do nearly anything from adding simple formatting rules to generating graphs and setting options for printing. Many different examples can be found on GitHub. What's more, there are other additional gems available:
- axlsx_rails - provides Rails templates for axlsx. A really nice solution that we will be using in this article
- actsasaxlsx - special ActiveRecord mixin equipping your models with the
to_xlsxmethod - activeadmin-xlsx - plugin for ActiveAdmin, which was mentioned in a SitePoint article on ActiveAdmin.
Continue reading %Generate Excel Spreadsheets with Rails and the Axlsx Gem%
by Ilya Bodrov-Krukowski via SitePoint
No comments:
Post a Comment