[null, {"document_url": "https://www.zkoss.org/wiki/Small%20Talks/2010/November/Use%20JavaBean%20in%20Excel%20with%20ZK%20Spreadsheet%202.0.0", "unformatted_src": "/_w/images/6/6c/Format.png", "src": "https://www.zkoss.org/_w/images/6/6c/Format.png", "formatted_filename": "Format", "alt_text": "Format.png", "rendered_width": 1073, "rendered_height": 833}, null, null]


From Documentation

Documentation>Small Talks>2010>November>Use JavaBean in Excel with ZK Spreadsheet 2.0.0
Use JavaBean in Excel with ZK Spreadsheet 2.0.0

Applicable to ZK Spreadsheet 2.0.0 EE and later

In this article, we will demonstrate how ZK Spreadsheet use external variables directly via Variable-Resolver.


In How to Build a Rich Excel Report with ZK Spreadsheet, we demonstrate how to use name ranges to integrate data from Excel into ZK framework and vice versa. In this article, we will solve it with a more powerful feature - Variable-Resolver. Instead of saving values with defining name ranges and refreshing values of cells with method setCellValue, you only need to assign bean name in cells of Excel to get the data from the server side! In other words, values in cells will be refreshed dynamically by reloading data of bean!

Let's start to build an application for calculating balance sheet with Variable-Resolver.

Live Demo

ERROR: Width and Height not set

How to Build a Template Using Excel

Define the Layout Template in Excel

You can design the format of Excel data: Input External Variable in Spreadsheet

Input bean and its data names in BalanceSheet.xls, such as dataBean.item, dataBean.liquidAssets, dataBean.fundInvestment etc.


Get Values via Variable-Resolver



In recent release of ZK Spreadsheet, developers can even bind Java Bean into a spreadsheet application as a data. That means you can got data from database or otherwhere ,so you can do more data control .It's really helpful for use a exists Excel file as template , and show dynamic data online.

If you have any questions or suggestions, please feel free to leave comments here or post to ZK forum.



If you'd like to know more about ZK Spreadsheet, please refer to the following URLs:

If you'd like to know more about Variable-Resolver, please refer to the following URL:

Retrieved from "https://www.zkoss.org/wiki/Small_Talks/2010/November/Use_JavaBean_in_Excel_with_ZK_Spreadsheet_2.0.0"
Categories: ZK Spreadsheet | Small Talk This page was last modified on 18 January 2011, at 08:07.
This page has been accessed 9,523 times.
Disclaimers | Modified by ZK
Partners :