纯前端表格控件spreadjs:如何利用javascript创建财务指标表

本示例展示了如何使用 SpreadJS 创建商业关键业绩指标表单, 例如财务关键业绩指标表单。各项表格大小、位置只需“拖拉拽”即可完成!

SpreadJS 是一款基于 HTML5 的纯前端电子表格控件,兼容 450 种以上的 Excel 公式,凭借其 “高性能、跨平台、与 Excel 高度兼容”的产品特性,备受以华为、苏宁易购、天弘基金等为代表的企业用户青睐。

日前,SpreadJS 正式发布V14.0版本。从该版本开始,SpreadJS加入了数据透视表插件,进一步降低企业数据分析的门槛,提升系统数据处理的能力。

下载spreadjs最新版

下面的示例展示了如何使用 SpreadJS 创建商业关键业绩指标表单, 例如财务关键业绩指标表单。各项表格大小、位置只需“拖拉拽”即可完成!

纯前端表格控件spreadjs:如何利用javascript创建财务指标表

具体代码如下:

app.js:

window.onload = function () {var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 1 });initSpread(spread);};function initSpread(spread) {var sd = data;if (sd.length > 0) {if (!spread) {return;}spread.suspendPaint();spread.fromJSON(sd[0]);spread.resumePaint();}}

index.html:

<!doctype html><html style="height:100%;font-size:14px;"><head><meta name="spreadjs culture" content="zh-cn" /><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><link rel="stylesheet" type="text/css" href="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css"><script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js" type="text/javascript"></script><script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets-resources-zh/dist/gc.spread.sheets.resources.zh.min.js" type="text/javascript"></script><script src="$DEMOROOT$/spread/source/js/license.js" type="text/javascript"></script><script src="$DEMOROOT$/spread/source/data/financialKPIs.js" type="text/javascript"></script><script src="app.js" type="text/javascript"></script><link rel="stylesheet" type="text/css" href="styles.css"></head><body><div class="sample-tutorial"><div id="ss" style="width:100%;height:100%"></div></div></body></html>

style.css

.sample-tutorial {position: relative;height: 100%;overflow: hidden;}body {position: absolute;top: 0;bottom: 0;left: 0;right: 0;}

小结:

作为Grapecity正版授权合作商,为你提供优质的服务、低廉的价额;还有多种授权方式供你选择!现适逢17周年促销活动spreadJS正版授权限时最高立减6278元!咨询客服更有3C数码、苹果手机、电脑等豪礼相送!

标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年11月6日
下一篇 2020年11月6日

相关推荐

发表回复

登录后才能评论