0

spreadsheet can't support map

asked 2009-05-14 05:06:18 +0800

mantuoluo gravatar image mantuoluo
132 1

hi,

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2009-05-14 05:06:26 +0800

mantuoluo gravatar image mantuoluo
132 1

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!

link publish delete flag offensive edit

answered 2009-05-17 04:01:42 +0800

mantuoluo gravatar image mantuoluo
132 1

anydoby give me some idea?

link publish delete flag offensive edit

answered 2009-05-18 06:56:16 +0800

PeterKuo gravatar image PeterKuo
481 2

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());

link publish delete flag offensive edit

answered 2009-05-18 11:47:49 +0800

mantuoluo gravatar image mantuoluo
132 1

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.

link publish delete flag offensive edit

answered 2009-05-19 02:05:32 +0800

PeterKuo gravatar image PeterKuo
481 2

Please give me the url of old zssdemo.
I go through the smalltalk about spreadsheet,
not found one with variable.xls

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-05-14 05:06:18 +0800

Seen: 174 times

Last updated: May 19 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More