provide access to spreadsheets from within webpages
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



SpreadButler - A System providing access to a spreadsheet from within a webpage


SpreadButler is a system for live integration of spreadsheet data into webpages. It uses ajax technology and is therefore independent of the technology used to create the webpages themselfes.

  • A Mojolicious server side application, able read an excel spread sheet and offering a rest interface to access its content.

  • A jQuery javascript plugin that requests data from from the server and inserts the data into a suitably prepared html table object.


SpreadButler uses perl with the Mojolicious and Spreadsheet::Read packages.

  • Install perl (5.8 or better 5.12)

  • Unpack in a directory of your choice aka $INSTALL_DIR

  • Make sure the prerequisite packages Mojolicious and Spreadsheet::Read packages are installed. The easiest way todo this, is to run

    $ cd setup
    $ ./

    This will create a thirdparty directory and copy all the required bits there.

  • Setup a directory where you store the spreadsheets you want to make available via SpreadButler ($SPREAD_BUTLER_DATA)

  • Integrate the SpreadButler fastcgi script into your webpage using a script like this:

    exec /INSTALL_DIR/ fastcgi

    and make sure your webserver actually executes this as a fastcgi script.


The client side integration of speadButler relies on javascript. The necessary files are served directly by SpreadButler. To use them in your webpage, just load them in the header using:

<script type="text/javascript" src="DIR/sb.fcgi/js/jquery.js"></script>
<script type="text/javascript" src="DIR/sb.fcgi/js/jquery.SpreadButler.js"></script>

To activate spreadButler, call the spreadButlerFillTable method on a table node:

<script type="text/javascript">
    server : 'DIR/sb.fcgi',
    file   : 'sample.xlsx',
    stopColumns: ['B','C'],
    startRow: 4,
    minColumn: 'B',
    maxColumn: 'F',
    minRow: '1',
    maxRow: '50',
    recalcClick: $('#recalcButton'),
    finalizeCallback: function(action){
             // check input
    sortCol: 1

This will fill data into the table with the mySpread id. Provding interactive recalculation by connecting with the click event on the recalcButton.

Rows of class sbReplace will get their td,th cells replaces with the evaluated result of the embedded javascript expression. The map d holds all the fields requested from the server.

Rows of class sbRepeat will get repeated for every row in the spreasheet, starting from startRow to the rwo where all columns mentioned in stopColumns are empty. The current row is available in the variable r.

  <input id="addField" type="text" value="1"></input>
  <button id="recalcButton">Calc!</button>
<table id="mySpread">
  <tr class="sbReplace">
  <tr class="sbRepeat">

You can enter multi statement javascript into table cells, but then there must be a return statement in your script. For single statement script, the return gets added implicitly.


Tobi Oetiker <>


2011-08-31 Initial Version


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.