页面树结构
转至元数据结尾
转至元数据起始

正在查看旧版本。 查看 当前版本.

与当前比较 查看页面历史

« 前一个 版本 7 当前 »

(本文档仅供参考)

问题

在excel里面预览是正常的,所有数据都是居左显示

但是发布预览之后,非0数值并没有左对齐

 

 

 

解决方案

该问题是第三方插件的bug,可以通过宏规避

如果是静态数据,可直接通过以下客户端宏来进行规避:

 

ClientSide    spreadsheetReport   onRender

function main(spreadsheetReport, isAjaxRefreshCallback)
{ var cell = spreadsheetReport.getCell("C5");
cell.firstChild.style.marginLeft = "0px";
cell = spreadsheetReport.getCell("C6");
cell.firstChild.style.marginLeft = "0px";
cell = spreadsheetReport.getCell("C7");
cell.firstChild.style.marginLeft = "0px";
cell = spreadsheetReport.getCell("C8");
cell.firstChild.style.marginLeft = "0px"; }

 

 

如果是动态数据,需要结合以下服务端和客户端宏来进行规避:

ServerSide  spreadsheetReport  onBeforeOutput

 

function main(spreadsheetReport) {
spreadsheetReport.printExpandedPositions();
}

 

ClientSide   spreadsheetReport   onRender

function main(spreadsheetReport, isAjaxRefreshCallback) {
var posList = spreadsheetReport.getExpandedPositions("C5"); //获取对应的扩展单元格列表
for (var i = 0; i < posList.length; i++) {
var cell = spreadsheetReport.getCell(posList[i]);
if (cell.innerText != 0) {
cell.firstChild.style.marginLeft = "0px";
}
}
}

 

Viewtracker License Missing

There is a problem with the license of the Viewtracker addon. Please check if you have a valid license.

授权码细节

  • 无标签