-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi, spreadsheet can't support map. the follow is my test zul file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
balance.zul
{{IS_NOTE
Purpose:
Description:
History:
Mon May 26 18:23:16 2008, Created by ivancheng
}}IS_NOTE
Copyright (C) 2008 Potix Corporation. All Rights Reserved.
{{IS_RIGHT
}}IS_RIGHT
-->
<window>
Quarter:
<listbox id="quarter" mold="select" rows="1" onSelect="refreshQuarter()">
<listitem value="0" label="Select"/>
<listitem value="1" label="Quarter 1"/>
<listitem value="2" label="Quarter 2"/>
<listitem value="3" label="Quarter 3"/>
<listitem value="4" label="Quarter 4"/>
</listbox>
Style:
<listbox id="style" mold="select" rows="1" onSelect="changeStyle()">
<listitem label="Style 1" value="/WEB-INF/xls/demo/balancesheet1.xls"/>
<listitem label="Style 2" value="/WEB-INF/xls/demo/balancesheet2.xls"/>
</listbox>
<zscript>
import org.zkoss.zss.demo.*;
void refreshQuarter() {
Listitem listitem = quarter.getSelectedItem();
int quarter = Integer.parseInt(listitem.value);
//Resolve variable data bean via ZssVariableResolver
queryQuarterBean(quarter, quarterBean);
//Call the method to refresh values of cells
balance.book.notifyChange(new String[]{"quarterBean"});
}
void queryQuarterBean(int quarter, quarterBean){
//Call the method to reload data
new ReportProvider().queryQuarterBean(quarter, quarterBean);
}
void changeStyle() { //Change the URL of spreadsheet
balance.url = style.getSelectedItem().value;
}
//QuarterBean quarterBean = new QuarterBean();
//initial data
//quarterBean = new ReportProvider().queryQuarterBean(0, quarterBean);
Map quarterBean= new HashMap();
quarterBean.put("item", "");
quarterBean.put("liquidAssets", 12.62);
quarterBean.put("fundInvestment", 25.15);
quarterBean.put("fixedAssets", 12.00);
quarterBean.put("intangibleAsset", 21.052);
quarterBean.put("otherAssets", 21.052);
quarterBean.put("currentLiabilities", 21.052);
quarterBean.put("longTermLiabilities", 21.052);
quarterBean.put("otherLiabilities", 21.052);
quarterBean.put("capitalStock", 21.052);
quarterBean.put("capitalSurplus", 21.052);
quarterBean.put("retainedEarnings", 21.052);
quarterBean.put("otherEquity", 21.052);
quarterBean.put("treasuryStock", 21.052);
</zscript>
<spreadsheet id="balance" url="/WEB-INF/xls/demo/balancesheet1.xls" maxrow="20" maxcolumn="20" height="350px" width="90%"/>
<textbox value="${quarterBean.liquidAssets}"></textbox>
</window>
the textbox value will be displayed correctly,but in balancesheet1.xls, if i use "${quarterBean.liquidAssets}",
zss will report unknown token $.
if i use "${quarterBean.liquidAssets}", zss will eat &,
so,what should i do?
please help me.
thanks!
Something confuse me,
how do you use "${quarterBean.liquidAssets}" in balancesheet1.xls??
In this smalltalk,
http://docs.zkoss.org/wiki/Generate_Huge_Data_Report_in_a_Second
I only see api usage like following example.
sheet.setCellValue(2+i*6, 2, computerBean.getId());
hi,thanks for reply,
in the old zssdemo , there is a file zssdemo\WEB-INF\xls\test\variable.xls.
we can see the ${userbean.firstName} usage,but the demo report a error,can't find $ token.
FullName FirstName LastName
userbean.fullName ${userbean.firstName} #NAME?
Val1 Val2 Val3
SUM 0
AVERAGE #DIV/0!
MAX 0
the userbean is a bean,i want to use a map to replace it.
Asked: 2009-05-14 05:06:18 +0800
Seen: 174 times
Last updated: May 19 '09