123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: rs
- // (C) Copyright IBM Corp. 2003, 2022.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- function _m45(_shh, _vdn, _5qm, _8bn){this._xng=_shh;this._p3n=_vdn;this._tim=_5qm;this._w2n=_8bn;};Object.defineProperties(_m45.prototype,{"json":{get:function(){return this._w2n;}},"name":{get:function(){return this._p3n;}},"rowCount":{get:function(){return this._w2n.rows.length;}},"columnCount":{get:function(){return this._w2n.columns.length;}},"columnNames":{get:function(){if(!this._5te){this._5te=[];var _tzl=this._w2n.columns.length;for(var i=0;i<_tzl;i++){var _vdn=this._w2n.columns[i].name;if(_vdn){this._5te[i]=_vdn;}}}return this._5te;}},"columnValues":{get:function(){if(!this._z8d){this._z8d=[];var _tzl=this._w2n.columns.length;for(var i=0;i<_tzl;i++){var a=this._w2n.columns[i].values;this._z8d[i]=a?a.concat():null;}}return this._z8d;}},"columnFormattedValues":{get:function(){if(!this._4b3){this._4b3=[];var _tzl=this._w2n.columns.length;for(var i=0;i<_tzl;i++){var a=this._w2n.columns[i].formattedValues;this._4b3[i]=a?a.concat():null;}}return this._4b3;}},"dataTypes":{get:function(){if(!this._dyh){this._dyh=[];var _tzl=this._w2n.columns.length;for(var i=0;i<_tzl;i++){var _a9k=this._w2n.columns[i].dataType;if(_a9k){this._dyh[i]=( _a9k=="decimal" )?"string":_a9k;}}}return this._dyh;}},"index":{get:function(){return this._tim;}}});_m45.prototype.getColumnIndex=function(sColumnName){_t02._b5b( null, "getColumnIndex", arguments, ["string"] );var i=this._jl4()[sColumnName];return(i===undefined)?NaN:i;};_m45.prototype.getCell=function(iRowIndex,iColumnIndex){_t02._b5b( null, "getCell", arguments, ["number", "number"] );this._wn8("getCell", iColumnIndex);return new _sf2(this, iRowIndex, iColumnIndex);};_m45.prototype.getCellValue=function(iRowIndex,iColumnIndex){_t02._b5b( null, "getCellValue", arguments, ["number", "number"] );this._wn8("getCellValue", iColumnIndex);var _75m=this._w2n.columns[iColumnIndex];var _sin=this._w2n.rows[iRowIndex];var _egk=_sin[iColumnIndex];return(_75m.values?_75m.values[_egk]:_egk);};_m45.prototype.getFormattedCellValue=function(iRowIndex,iColumnIndex){_t02._b5b( null, "getFormattedCellValue", arguments, ["number", "number"] );this._wn8("getFormattedCellValue", iColumnIndex);var _75m=this._w2n.columns[iColumnIndex];var _sin=this._w2n.rows[iRowIndex];var _egk=_sin[iColumnIndex];return _75m.formattedValues?_75m.formattedValues[_egk]:String(_75m.values?_75m.values[_egk]:_egk);};_m45.prototype.sort=function(iColumnIndex,bAscending){_t02._b5b( null, "sort", arguments, ["number", "boolean"] );this._wn8("sort", iColumnIndex);return new _m45(this._xng, "", NaN, this._tbg()._kgn(iColumnIndex, bAscending)._4kl());};_m45.prototype.project=function(aProjectionMethods,bRemoveColumns){_t02._b5b( null, "sort", arguments, ["array", "boolean"], [false, true] );for(var i=0;i<aProjectionMethods.length;i++){if(aProjectionMethods[i]==""){aProjectionMethods[i]=undefined;}}var _8bn=this._tbg()._ell(aProjectionMethods)._4kl();if(bRemoveColumns){_8bn=JSON.parse(JSON.stringify(_8bn));var _x4n=[];for(var i=0;i<aProjectionMethods.length;i++){_x4n[i]=(aProjectionMethods[i]!==undefined);}var _cpm=this._zg6.bind(this, _x4n);_8bn.columns=_8bn.columns.filter(_cpm);for(var _ekn=0;_ekn<_8bn.rows.length;_ekn++){_8bn.rows[_ekn]=_8bn.rows[_ekn].filter(_cpm);}}return new _m45(this._xng, "", NaN, _8bn);};_m45.prototype._zg6=function(_x4n,v,i){return _x4n[i];};_m45.prototype._wn8=function(_h9m,iColumnIndex){if((iColumnIndex<0)||((iColumnIndex+1)>this.columnCount)){throw new _t02(this._xng, _h9m, _frh._c6j("IDS_CCHL_SCRIPTING_ERR_ARG_INDEX_OUT_OF_BOUNDS", iColumnIndex, 0, this.columnCount-1));}};_m45.prototype._jl4=function(){if(!this._qo6){this._qo6=_bnl._fr(this._w2n.columns, "name");}return this._qo6;};_m45.prototype._tbg=function(){if(!this._gjj){this._gjj=new _ugk(this._w2n);}return this._gjj;};
|