我是 Oracle APEX 的新手,我使用的是 apex 版本 21.1.0,我只想上传受密码保护的 excel 文件,所以我使用了 Spread JS java 脚本插件,而我正在尝试集成我得到以下错误附在屏幕截图中。
我有一个如下所示的 Oracle APEX 表格:
我创建了一个区域和三个页面项
- 文件上传类型 - 文件
- 密码输入类型 - 密码
- 按钮类型 - 按钮
页面属性如下:
我在 HTML Header 中添加了以下代码
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="https://www.grapecity.com/spreadjs/demos/en/purejs /node_modules/@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css">
<script src="https://www.grapecity.com/spreadjs/demos/en/purejs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js" type="text/javascript"></script>
<script src="https://www.grapecity.com/spreadjs/demos/spread/source/js/FileSaver.js" type="text/javascript"></script>
<script src="https://www.grapecity.com/spreadjs/demos/en/purejs/node_modules/@grapecity/spread-excelio/dist/gc.spread.excelio.min.js" type="text/javascript"></script>
<script src="https://www.grapecity.com/spreadjs/demos/en/purejs/node_modules/@grapecity/spread-sheets-charts/dist/gc.spread.sheets.charts.min.js" type="text/javascript"></script>
<script src="https://www.grapecity.com/spreadjs/demos/spread/source/js/license.js" type="text/javascript"></script>
<script src="https://www.grapecity.com/spreadjs/demos/spread/source/data/excel_data.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function () {
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("append"), {calcOnDemand: true});
spread.fromJSON(jsonData);
var excelIo = new GC.Spread.Excel.IO();
document.getElementById('B43349412666678933129').onclick = function () {
var excelFile = document.getElementById("P2_UPLOAD_FILE").files[0];
var password = document.getElementById('P2_PASSWORD').value;
// here is excel IO API
excelIo.open(excelFile, function (json) {
var workbookObj = json;
spread.fromJSON(workbookObj);
}, function (e) {
// process error
alert(e.errorMessage);
if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
document.getElementById('P2_PASSWORD').onselect = null;
}
}, {password: password});
};
};
</script>
</head>
<body>
<div id="append"></div>
</body>
如果我错了或遗漏了什么,请纠正我。
谢谢,