// Licensed Materials - Property of IBM // // IBM Cognos Products: pps // // (C) Copyright IBM Corp. 2005, 2017 // // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. function getLastItemStr(str) { var codeSep = topparent.getGlobal("codeSeparator"); if (str.indexOf(codeSep)) { var subs = str.split(codeSep); return subs[subs.length - 1]; } else { return str; } } function replaceRows(obj) { var com = doPreUnHideCommand(obj); com += 'ER' + ':' + 'R-1' + '\t' + 'D' + obj.getAttribute("dimIdx") + '\t' + getLastItemStr(obj.getAttribute("ppdsId")) + "," + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); topparent.getXtabFrame().doit(com); } function replaceCols(obj) { var com = doPreUnHideCommand(obj); com += 'ER' + ':' + 'C-1' + '\t' + 'D' + obj.getAttribute("dimIdx") + '\t' + getLastItemStr(obj.getAttribute("ppdsId")) + "," + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); topparent.getXtabFrame().doit(com); } function nestRowsInner(obj) { var xtabFrame = topparent.getXtabFrame(); var targetDim = xtabFrame.rowDimIdx[parseInt(xtabFrame.numRowLevels) - 1]; var com = doPreUnHideCommand(obj); com += 'EN:R' + (parseInt(xtabFrame.numRowLevels) - 1) + '\tD' + obj.getAttribute("dimIdx") + '\t' + obj.getAttribute("level"); if (obj.getAttribute("dimIdx") != targetDim) //need to isolate the correct nesting group, as we are nesting from another dimension com += '\t\t' + 'DG:R' + xtabFrame.numRowLevels + '\t' + getLastItemStr(obj.getAttribute("ppdsId")) + ',' + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); xtabFrame.doit(com); } function nestColsInner(obj) { var xtabFrame = topparent.getXtabFrame(); var targetDim = xtabFrame.colDimIdx[parseInt(xtabFrame.numColLevels) - 1]; var com = doPreUnHideCommand(obj); com += 'EN:C' + (xtabFrame.numColLevels - 1) + '\tD' + obj.getAttribute("dimIdx") + '\t' + obj.getAttribute("level"); if (obj.getAttribute("dimIdx") != targetDim ) //need to isolate the correct nesting group, as we are nesting from another dimension com += '\t\t' + 'DG:C' + xtabFrame.numColLevels + '\t' + getLastItemStr(obj.getAttribute("ppdsId")) + ',' + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); xtabFrame.doit(com); } function filter(obj) { var com = 'DC' + ':' + getLastItemStr(obj.getAttribute("ppdsId")) + "," + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); topparent.getXtabFrame().doit(com); } function nestRowsOuter(obj) { var xtabFrame = topparent.getXtabFrame(); var targetDim = xtabFrame.rowDimIdx[parseInt(xtabFrame.numRowLevels) - 1]; var com = doPreUnHideCommand(obj); com += 'EN:R-1\tD' + obj.getAttribute("dimIdx") + '\t' + obj.getAttribute("level"); if (obj.getAttribute("dimIdx") != targetDim) //need to isolate the correct nesting group, as we are nesting from another dimension com += '\t\t' + 'DG:R' + xtabFrame.numRowLevels + '\t' + getLastItemStr(obj.getAttribute("ppdsId")) + ',' + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); xtabFrame.doit(com); } function nestColsOuter(obj) { var xtabFrame = topparent.getXtabFrame(); var targetDim = xtabFrame.colDimIdx[parseInt(xtabFrame.numRowLevels) - 1]; var com = doPreUnHideCommand(obj); com += 'EN:C-1\tD' + obj.getAttribute("dimIdx") + '\t' + obj.getAttribute("level"); if (obj.getAttribute("dimIdx") != targetDim ) //need to isolate the correct nesting group, as we are nesting from another dimension com += '\t\t' + 'DG:C' + xtabFrame.numColLevels + '\t' + getLastItemStr(obj.getAttribute("ppdsId")) + ',' + obj.getAttribute("dimIdx") + ';' + getLastItemStr(obj.getAttribute("code")); xtabFrame.doit(com); } function replaceMeasure(obj) { var com = "DC:" + getLastItemStr(obj.getAttribute("ppdsId")) + ',' + obj.getAttribute("dimIdx") + ',' + getLastItemStr(obj.getAttribute("code")); topparent.getXtabFrame().doit(com); } function doPreUnHideCommand(obj) { var cmd = ""; if (topparent.getGlobal("gDimensionInfo")[obj.getAttribute("dimIdx")].isMeasureDimension) { cmd = "MS:0\t" + getLastItemStr(obj.getAttribute("ppdsId")) + ',' + obj.getAttribute("dimIdx") + ',' + getLastItemStr(obj.getAttribute("code")) + "\t\t"; } return cmd; }