1. Products
  2.   Spreadsheet
  3.   Ruby
  4.   Spreadsheet Architect
 
  

Create XLSX, ODS, or CSV Files via Ruby Spreadsheet Library

Open Source Ruby API to Generate and Handle XLSX, ODS, or CSV Spreadsheets Documents, Generate Multi-sheet Spreadsheets Files, Add Rows & Columns via Ruby Commands.

What is Spreadsheet Architect?

For developers seeking a streamlined, open source Ruby spreadsheet API, Spreadsheet Architect delivers a powerful and intuitive solution for generating documents directly from your data. This versatile, free Ruby Excel library empowers you to effortlessly create Excel XLSX files as well as create CSV files and ODS spreadsheet documents. It simplifies the workflow by converting data from various sources—including ActiveRecord relations, plain Ruby objects, or simple tabular arrays—into fully formatted spreadsheets with just a few commands, making report generation both fast and efficient.

The library excels in providing comprehensive tools to deeply modify Excel XLSX files and craft detailed workbooks. A standout feature is the ability to generate multi-sheet spreadsheets with distinct datasets in each tab. You can easily structure content by adding images & rows to worksheet, applying custom styles for fonts, colors, and alignment, and organizing data with headers. With built-in style aliases for rapid formatting, Spreadsheet Architect handles everything from basic cell customization to building complex, professionally styled reports, all within a clean and stable Ruby-centric API.

Previous Next

Getting Started with Spreadsheet Architect

The recommended way to install Spreadsheet Architect into your project is by using RubyGems. Please use the following command for an easy installation.

Install Spreadsheet Architect via RubyGems

gem 'spreadsheet_architect' 

Generate XLSX and ODS Spreadsheet via Ruby

The open source Ruby library Spreadsheet Architect has provided software developers the capability to generate XLSX and ODS documents with ease. You can easily add new sheets, update existing sheets, rename sheets, apply formatting to a range of cells, and much more. The library also provides support for editing the contents of a sheet with just a couple of lines of code.

How to Generate Multi Sheet XLSX Spreadsheets via Ruby AP?

axlsx_package = SpreadsheetArchitect.to_axlsx_package({headers: headers, data: data})
axlsx_package = SpreadsheetArchitect.to_axlsx_package({headers: headers, data: data}, axlsx_package)

File.open('path/to/multi_sheet_file.xlsx', 'w+b') do |f|
  f.write axlsx_package.to_stream.read
end

Combine Multiple Worksheets via Ruby

The free library Spreadsheet Architect enables software programmers to combine multiple worksheets into a single file using Ruby commands. You need to provide the names and complete addresses of the worksheets. After that, it is very easy to join them on another sheet of your choice. Once the process is completed you can easily apply new styles, add new columns or rows, and insert images to it with ease.

Add Images & Styles to Excel Worksheet

The open source Ruby library Spreadsheet Architect gives software programmers the capability to add images inside their spreadsheet with just a couple of lines of Ruby code. You can easily style and customize spreadsheet contents. A developer can adjust its size, replace it with another image, and delete unwanted images with ease.

How to Wrap Text via Ruby API?

$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
require 'axlsx'
p = Axlsx::Package.new
p.workbook do |wb|
  wb.styles do |s|
    wrap_text = s.add_style :fg_color=> "FFFFFF",
                            :b => true,
                            :bg_color => "004586",
                            :sz => 12,
                            :border => { :style => :thin, :color => "00" },
                            :alignment => { :horizontal => :center,
                                            :vertical => :center ,
                                            :wrap_text => true}
    wb.add_worksheet(:name => 'wrap text') do |sheet|
      sheet.add_row ['Torp, White and Cronin'], :style => wrap_text
      # Forcing the column to be a bit narrow so we can see if the text wrap.
      sheet.column_info.first.width = 5
    end
  end
end
p.serialize 'wrap_text.xlsx'
 English