本帖最后由 manabout 于 2016-10-20 18:24 编辑
附件中的excel用spreadjs设计器导出为js文件后,使用spread.fromJSON(JSON.parse(text))导入JSON后,公式出现错误。而原来的excel是没有问题的。使用贵公司提供的下载的示例将此js发送到下载服务器后,却能正常下载
var content = '{"spread":' + text + ', "exportFileType": "xlsx", "exportFileName": "' + fileName+ '" ,"excel": {"saveFlags": 0, "password": ""}}'; var serverUrl = "http://172.16.126.211:8022//Home/Export";
var formInnerHtml = '<input type="hidden" name="type" value="application/json" />';
formInnerHtml += '<input type="hidden" name="data" value="' + htmlSpecialCharsEntityEncode(content) + '" />';
content = null;
var $iframe = $("<iframe style='display: none' src='about:blank'></iframe>").appendTo("body");
$iframe.ready(function () {
var formDoc = getiframeDocument($("iframe"));
formDoc.write("<html><head></head><body><form method='Post' action='" + serverUrl + "'>" + formInnerHtml + "</form>dummy windows for postback</body></html>");
formInnerHtml = null;
var $form = $(formDoc).find('form');
$form.submit();
$form[0].reset();
});
|
|