From Documentation

ZK Spreadsheet is an Ajax component that delivers the rich functionality of Excel on the Java Web application.

Being able to import and export Excel files are just the minimum. Unlike other on-line spreadsheet such as Google Docs or Office 2010 online suite, you can integrate ZK Spreadsheet with your enterprise back-end systems seamlessly and create collaborative and dynamic enterprise applications at minimal cost. You can call versatile Java APIs to control and configure the ZK Spreadsheet component(s). You can register event listeners so an action can be automatically triggered if any specified cell, range, or name changes. You can data bind cells to the back-end Java beans, so any changes on the back-end data would be automatically reflected on the ZK Spreadsheet. You can create your own customized spreadsheet functions in Java and use them in the spreadsheet formulas. Actually, if you like, you can even create by yourselves an on line spreadsheet service with ZK Spreadsheet component.

ZK Spreadsheet is an extensible, customizable, and integratable Java Ajax Web spreadsheet solution, with both built in browser Ajax user interface and back-end server side Excel-like data and logic. None of ActiveX or plug-ins is needed.



ZK Spreadsheet component consist of three major parts -- the UI view part, the work book data model, and the formula evaluation engine. The UI part is a grid like component that you can in-place edit the contents of spreadsheet cells. The work book data model stores the real spreadsheet data. The formula evaluation engine is responsible for spreadsheet formula parsing and calculation.

Loading a Work Book

  • ZK Spreadsheet UI component must work with a ZK Spreadsheet work book model. You can set book source URL to the UI component directly or prepare a work book model(e.g. by importing or by creating Book object) yourself and set the book to the UI component.
  • The ZK Spreadsheet UI will then popular itself with the work book data.

Note that you can have one book to be associated with several ZK Spreadsheet UI components simultaneously. Data changes to the work book will be reflected to all associated ZK Spreadsheet UI components automatically.

Execution Flow of Serving a Cell Modification Request

  1. When an end user do some action such as input a new value into a cell on the browser side ZK spreadsheet widget, the widget would fire back to the server side ZK Spreadsheet UI component a ZK event to notify the change.
  2. ZK Spreadsheet UI component will then call the proper control APIs to change the workbook data model.
  3. The formula engine then take over to check the formula dependency and collect associated cells that need to be updated accordingly; then publish data change event to notify the ZK Spreadsheet UI component.
  4. Per the data change event published from the work book, the ZK Spreadsheet UI component update itself accordingly.
  5. The change will then be reflect back to the browser widget automatically by ZK Framework.

Note that the ZK Spreadsheet work book model is not limited to be used with ZK Spreadsheet UI component only. You can call the control APIs in your application to change the ZK Spreadsheet work book and the associated ZK Spreadsheet UI part will still be updated accordingly. Further more, you can even associate other ZK components to the work book's data change event queue and do something whenever the work book publish data change events.

Version History

Last Update : 2010/11/16

Version Date Content

All source code listed in this book is at Github.

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.