Setting Up ZK Spreadsheet"

From Documentation
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{ZKSpreadsheetEssentialsPageHeader}}
 
{{ZKSpreadsheetEssentialsPageHeader}}
 +
 +
{{Deprecated|url=http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials}}
 +
 +
  
 
Follow the simple setups below to start using ZK Spreadsheet.
 
Follow the simple setups below to start using ZK Spreadsheet.
  
 
===Purpose===
 
===Purpose===
Show the simplest way to start using ZK Spreadsheet!
+
Start using ZK Spreadsheet!
  
 
===Prerequisites===
 
===Prerequisites===
Line 13: Line 17:
 
===Installing the Libraries===
 
===Installing the Libraries===
  
The setup procedure depends on your choice of IDE. The most important part is including both ZK Spreadsheet and ZK’s JAR files in your project. The project should be a ZK Project or a Web Application Project depending on the environment you are using.  
+
The setup procedure depends on your choice of IDE. The most important part is to include both ZK Spreadsheet and ZK’s JAR files in your project. The project should be a ZK Project or a dynamic Web Application Project depending on the environment you are using.  
  
The easiest way to create a compatible project is to use [http://www.zkoss.org/download/zkstudio.dsp ZK Studio] and then include all essential libraries. All libraries can be download from page [http://www.zkoss.org/download/zkspreadsheet.dsp], inside '''ZK Spreadsheet binary'''.
+
The easiest way to create a compatible project is to use [http://www.zkoss.org/download/zkstudio.dsp ZK Studio] and then include all the essential libraries. All libraries can be downloaded from the page [http://www.zkoss.org/download/zkspreadsheet.dsp], inside '''ZK Spreadsheet binary'''.
  
 
===A Very Basic Application===
 
===A Very Basic Application===
  
Having completed setting up ZK and ZK Spreadsheet, we'll also need to prepare a Excel file as a source of the spreadsheet.
+
Having completed setting up ZK and ZK Spreadsheet, we'll also need to prepare an Excel file as a source of the spreadsheet.
 
We then create an index.zul file to contain the spreadsheet as shown in the code below:
 
We then create an index.zul file to contain the spreadsheet as shown in the code below:
  
Line 39: Line 43:
 
* maxrows: The maximum number of columns of  this spread sheet
 
* maxrows: The maximum number of columns of  this spread sheet
 
* maxcolumns: The maximum number of rows of this spread sheet
 
* maxcolumns: The maximum number of rows of this spread sheet
* hflex and vflex: ZK's attribute, refer to [http://docs.zkoss.org/wiki/ZK_5:_More_Flexible_Layout]
+
* hflex and vflex: ZK's attribute, refer to [[Small_Talks/2009/September/ZK_5:_More_Flexible_Layout|ZK 5: More Flexible Layout]]
 
 
  
 
This gives us our very first ZK Spreadsheet application. When the code is started, navigate to index.zul and the following page should be displayed.
 
This gives us our very first ZK Spreadsheet application. When the code is started, navigate to index.zul and the following page should be displayed.

Latest revision as of 06:35, 22 August 2013


Setting Up ZK Spreadsheet



Stop.png This article is out of date, please refer to http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials for more up to date information.


Follow the simple setups below to start using ZK Spreadsheet.

Purpose

Start using ZK Spreadsheet!

Prerequisites

  • Downloaded ZK 5 CE (or higher) from [1]
  • Downloaded ZK Spreadsheet 2.0 from [2]

Installing the Libraries

The setup procedure depends on your choice of IDE. The most important part is to include both ZK Spreadsheet and ZK’s JAR files in your project. The project should be a ZK Project or a dynamic Web Application Project depending on the environment you are using.

The easiest way to create a compatible project is to use ZK Studio and then include all the essential libraries. All libraries can be downloaded from the page [3], inside ZK Spreadsheet binary.

A Very Basic Application

Having completed setting up ZK and ZK Spreadsheet, we'll also need to prepare an Excel file as a source of the spreadsheet. We then create an index.zul file to contain the spreadsheet as shown in the code below:

<?xml version="1.0" encoding="UTF-8"?>

<zk xmlns="http://www.zkoss.org/2005/zul">
    <spreadsheet src="/demo_sample.xls"	
			maxrows="200" 
			maxcolumns="40"
			hflex="1" 
			vflex="1"></spreadsheet>
</zk>


Attributes

  • src: The source file of the spreadsheet
  • maxrows: The maximum number of columns of this spread sheet
  • maxcolumns: The maximum number of rows of this spread sheet
  • hflex and vflex: ZK's attribute, refer to ZK 5: More Flexible Layout

This gives us our very first ZK Spreadsheet application. When the code is started, navigate to index.zul and the following page should be displayed.

ZKSsEss Simple spreadsheet application.png


Congratulations! That is all it takes to embed ZK Spreadsheet within your ZK application.

Version History

Last Update : 2013/08/22


Version Date Content
     


All source code listed in this book is at Github.


Last Update : 2013/08/22

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