Change the Style of Spreadsheet within 1 Min

Ivan Cheng, Engineer, Potix Corporation
April 25, 2008

Version

Applicable to ZK 3.0.5 and later

Applicable to ZK Spreadsheet 1.0.0 and later

Introduction

In Use JavaBean in Excel with ZK Spreadsheet, we demonstrate how to use JavaBean directly via Variable-Resolver. In this article, we will introduce another practical application about how to change the style of spreadsheet with ease. No modification of data model is required. In the following paragraphs, I will show you how to change the style of spreadsheet.


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:


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

Live Demo

How to Build a Template Using Excel

Design a New Layout Template in Excel


NewSheet.xls

Define External Variable

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

NewSheet.xls

Change the Style of Spreadsheet

sheet.zul

	......
	
  <listbox id="style" mold="select" rows="1" onSelect="changeStyle()">
  	<listitem label="Style 1" value="/BalanceSheet.xls"/>
  	<listitem label="Style 2" value="/NewSheet.xls"/>
  </listbox>
  
	......
	
	void changeStyle() {  //Change the URL of spreadsheet
			balance.url = style.getSelectedItem().value;
	}
	
	......

  <spreadsheet id="balance" url="/BalanceSheet.xls" maxrow="40" maxcolumn="20" height="600px" width="1300px"/>
	
	......


Download

ZssChangeStyle.war

Conclusion

It becomes more convenient to integrate server side resource by binding Java Bean with spreadsheet. This feature simplifies developer's job to meet the user's requirement of style. In the near future, we will introduce more useful tools of ZK Spreadsheet. We expect your response to make it better, feel free to leave a message or post it to ZK forum .
Comments
 
maoyang
2008-04-25

Is it possible export ZK's Excel report to PDF ?

Jeff
2008-04-25

This feature is not supported yet. It is a great suggestion. Please post it to feature request.

manuel rodriguez
2008-11-07

I not find about print in shett...how to print the sheet ?
does the zss has a tutorial or some documents to study?

is a way to send to jasper..for preview view
Is it possible export ZK's Excel report to PDF ?

 
 
Leave a Reply
 
Name (required)
Mail (will not be published) (required)
Website
(Case Insensitive)
Bold textItalic textUnderLine textSource CodeHorizontal rulerExternal Link
Post
Preview