|  | @@ -2,7 +2,6 @@ let JV = require('./jpc_value_define');
 | 
	
		
			
				|  |  |  let JpcFieldHelper = require('./helper/jpc_helper_field');
 | 
	
		
			
				|  |  |  let JpcBandHelper = require('./helper/jpc_helper_band');
 | 
	
		
			
				|  |  |  let JpcBand = require('./jpc_band');
 | 
	
		
			
				|  |  | -let JpcFlowTabHelper = require('./helper/jpc_helper_flow_tab');
 | 
	
		
			
				|  |  |  let JpcCrossTabHelper = require('./helper/jpc_helper_cross_tab');
 | 
	
		
			
				|  |  |  let JpcCommonHelper = require('./helper/jpc_helper_common');
 | 
	
		
			
				|  |  |  let JpcDiscreteHelper = require('./helper/jpc_helper_discrete');
 | 
	
	
		
			
				|  | @@ -22,7 +21,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |              if (sortedSequence) {
 | 
	
		
			
				|  |  |                  let arrDupVals = sortedSequence[segIdx];
 | 
	
		
			
				|  |  |                  let arrDupSumVals = null;
 | 
	
		
			
				|  |  | -                if (sorted_sum_value_Lst != null) {
 | 
	
		
			
				|  |  | +                if (sorted_sum_value_Lst !== null) {
 | 
	
		
			
				|  |  |                      arrDupSumVals = sorted_sum_value_Lst[segIdx];
 | 
	
		
			
				|  |  |                      sumValL = arrDupSumVals[0].length;
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -34,24 +33,24 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                          for (let ei = 0; ei < sumValL; ei++) {
 | 
	
		
			
				|  |  |                              sumVal[i][ei] = null;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        if (serial1stTier != null) {
 | 
	
		
			
				|  |  | +                        if (serial1stTier !== null) {
 | 
	
		
			
				|  |  |                              serial1stTier[i] = JV.BLANK_VALUE_INDEX;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          continue;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      let duplicateValueArr = arrDupVals[preRec + i];
 | 
	
		
			
				|  |  |                      pgseg1stTier[i] = duplicateValueArr[0];
 | 
	
		
			
				|  |  | -                    if (arrDupSumVals != null) sumVal[i] = arrDupSumVals[preRec + i];
 | 
	
		
			
				|  |  | +                    if (arrDupSumVals !== null) sumVal[i] = arrDupSumVals[preRec + i];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    if (serial1stTier != null) {
 | 
	
		
			
				|  |  | +                    if (serial1stTier !== null) {
 | 
	
		
			
				|  |  |                          serial1stTier[i] = preRec + i;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  tabValuedIdxLst.push(pgseg1stTier);
 | 
	
		
			
				|  |  | -                if (dispSerialIdxLst != null) {
 | 
	
		
			
				|  |  | +                if (dispSerialIdxLst !== null) {
 | 
	
		
			
				|  |  |                      dispSerialIdxLst.push(serial1stTier);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                if (sorted_sum_value_Lst != null && rst_sum_value_Lst != null) {
 | 
	
		
			
				|  |  | +                if (sorted_sum_value_Lst !== null && rst_sum_value_Lst !== null) {
 | 
	
		
			
				|  |  |                      rst_sum_value_Lst.push(sumVal);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              } else {
 | 
	
	
		
			
				|  | @@ -59,25 +58,25 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                  for (let i = 0; i < nextRec; i++) {
 | 
	
		
			
				|  |  |                      pgseg1stTier[i] = JV.BLANK_VALUE_INDEX;
 | 
	
		
			
				|  |  |                      sumVal[i] = null;
 | 
	
		
			
				|  |  | -                    if (serial1stTier != null) {
 | 
	
		
			
				|  |  | +                    if (serial1stTier !== null) {
 | 
	
		
			
				|  |  |                          serial1stTier[i] = JV.BLANK_VALUE_INDEX;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  tabValuedIdxLst.push(pgseg1stTier);
 | 
	
		
			
				|  |  | -                if (dispSerialIdxLst != null) {
 | 
	
		
			
				|  |  | +                if (dispSerialIdxLst !== null) {
 | 
	
		
			
				|  |  |                      dispSerialIdxLst.push(serial1stTier);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                if (sorted_sum_value_Lst != null && rst_sum_value_Lst != null) {
 | 
	
		
			
				|  |  | +                if (sorted_sum_value_Lst !== null && rst_sum_value_Lst !== null) {
 | 
	
		
			
				|  |  |                      rst_sum_value_Lst.push(sumVal);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      function private_addContentValue(dispValueIdxLst_Content, sortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, page_seg_map, pageIdx) {
 | 
	
		
			
				|  |  | -        if (dispValueIdxLst_Content != null) {
 | 
	
		
			
				|  |  | +        if (dispValueIdxLst_Content !== null) {
 | 
	
		
			
				|  |  |              page_seg_map.push([pageIdx,segIdx]);
 | 
	
		
			
				|  |  |              let arrContents = [];
 | 
	
		
			
				|  |  | -            if (sortedContentSequence != null) {
 | 
	
		
			
				|  |  | +            if (sortedContentSequence !== null) {
 | 
	
		
			
				|  |  |                  let arrAllContent = sortedContentSequence[segIdx];
 | 
	
		
			
				|  |  |                  for (let i = 0; i < maxRowRec; i++) {
 | 
	
		
			
				|  |  |                      arrContents.push([]);
 | 
	
	
		
			
				|  | @@ -117,13 +116,13 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |              for (let i = 0; i < dataSeq.length; i++) {
 | 
	
		
			
				|  |  |                  sIDX = 0;
 | 
	
		
			
				|  |  |                  let segArr = [];
 | 
	
		
			
				|  |  | -                if (dataSeq[i].length == 1) {
 | 
	
		
			
				|  |  | +                if (dataSeq[i].length === 1) {
 | 
	
		
			
				|  |  |                      JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, 0, 1);
 | 
	
		
			
				|  |  |                  } else {
 | 
	
		
			
				|  |  |                      for (let j = 1; j < dataSeq[i].length; j++) {
 | 
	
		
			
				|  |  |                          b1 = false;
 | 
	
		
			
				|  |  |                          for (let k = 0; k < rstFieldsIdx.length; k++) {
 | 
	
		
			
				|  |  | -                            if (data_details[rstFieldsIdx[k]][dataSeq[i][j - 1]] != data_details[rstFieldsIdx[k]][dataSeq[i][j]]) {
 | 
	
		
			
				|  |  | +                            if (data_details[rstFieldsIdx[k]][dataSeq[i][j - 1]] !== data_details[rstFieldsIdx[k]][dataSeq[i][j]]) {
 | 
	
		
			
				|  |  |                                  b1 = true;
 | 
	
		
			
				|  |  |                                  break;
 | 
	
		
			
				|  |  |                              }
 | 
	
	
		
			
				|  | @@ -131,10 +130,10 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                          if (b1) {
 | 
	
		
			
				|  |  |                              JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, sIDX, j);
 | 
	
		
			
				|  |  |                              sIDX = j;
 | 
	
		
			
				|  |  | -                            if (j == dataSeq[i].length - 1) {
 | 
	
		
			
				|  |  | +                            if (j === dataSeq[i].length - 1) {
 | 
	
		
			
				|  |  |                                  JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, j, dataSeq[i].length);
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | -                        } else if (j == dataSeq[i].length - 1) {
 | 
	
		
			
				|  |  | +                        } else if (j === dataSeq[i].length - 1) {
 | 
	
		
			
				|  |  |                              JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, sIDX, dataSeq[i].length);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -193,6 +192,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          me.row_sum_extension_fields_idx = [];
 | 
	
		
			
				|  |  |          me.crsOrient = JV.PAGE_ORIENTATION_V_FIRST;
 | 
	
		
			
				|  |  |          me.pageStatusLst = [];
 | 
	
		
			
				|  |  | +        me.paging_option = JV.PAGING_OPTION_NORMAL;
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      JpcCrossTabResult.sorting = function(rptTpl, dataObj, dataSeq) {
 | 
	
		
			
				|  |  |          let me = this;
 | 
	
	
		
			
				|  | @@ -227,7 +227,8 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      JpcCrossTabResult.preSetupPages = function(rptTpl, defProperties, option) {
 | 
	
		
			
				|  |  | -        let rst = 0, me = this, dftPagingOption = option||JV.PAGING_OPTION_NORMAL;
 | 
	
		
			
				|  |  | +        let me = this, rst = 0;
 | 
	
		
			
				|  |  | +        me.paging_option = option||JV.PAGING_OPTION_NORMAL;
 | 
	
		
			
				|  |  |          //1. original initialize
 | 
	
		
			
				|  |  |          let maxRowRec = 1, maxColRec = 1, counterRowRec = 0, counterColRec = 0, pageIdx = 0, segCnt = me.sortedContentSequence.length;
 | 
	
		
			
				|  |  |          let pageStatus = [true, true, false, true, false, false, false, false];
 | 
	
	
		
			
				|  | @@ -240,83 +241,137 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT][JV.TAB_CROSS_FIELDS], null, me.row_extension_fields_idx);
 | 
	
		
			
				|  |  |          JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT][JV.TAB_CROSS_FIELDS], null, me.row_sum_extension_fields_idx);
 | 
	
		
			
				|  |  | -        for (let segIdx = 0; segIdx < segCnt; segIdx++) {
 | 
	
		
			
				|  |  | -            //2.1. seg level initialize
 | 
	
		
			
				|  |  | -            private_resetBandArea();
 | 
	
		
			
				|  |  | -            let orgMaxRowRec = maxRowRec, orgMaxColRec = maxColRec;
 | 
	
		
			
				|  |  | -            let rowSplitCnt = Math.ceil(1.0 * me.sortedRowSequence[segIdx].length / maxRowRec);
 | 
	
		
			
				|  |  | -            let colSplitCnt = Math.ceil(1.0 * me.sortedColSequence[segIdx].length / maxColRec);
 | 
	
		
			
				|  |  | +        if (me.paging_option === JV.PAGING_OPTION_INFINITY) {
 | 
	
		
			
				|  |  | +            /*
 | 
	
		
			
				|  |  | +            rst = segCnt;
 | 
	
		
			
				|  |  | +            pageStatus[JV.STATUS_SEGMENT_START] = true;
 | 
	
		
			
				|  |  | +            pageStatus[JV.STATUS_SEGMENT_END] = true;
 | 
	
		
			
				|  |  |              pageStatus[JV.STATUS_CROSS_ROW_END] = true;
 | 
	
		
			
				|  |  | -            private_resetBandArea();
 | 
	
		
			
				|  |  | -            let hasAdHocRow = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_ROW_SUM, rptTpl, bands, me.sortedRowSequence, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
 | 
	
		
			
				|  |  | -            if (hasAdHocRow) {
 | 
	
		
			
				|  |  | -                hasAdHocRow = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_ROW_EXT, rptTpl, bands, me.sortedRowSequence, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            pageStatus[JV.STATUS_CROSS_ROW_END] = false;
 | 
	
		
			
				|  |  |              pageStatus[JV.STATUS_CROSS_COL_END] = true;
 | 
	
		
			
				|  |  | -            private_resetBandArea();
 | 
	
		
			
				|  |  | -            let hasAdHocCol = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_COL_SUM, rptTpl, bands, me.sortedColSequence, segIdx, (colSplitCnt - 1) * orgMaxColRec, maxColRec);
 | 
	
		
			
				|  |  | -            pageStatus[JV.STATUS_CROSS_COL_END] = false;
 | 
	
		
			
				|  |  | -            private_resetBandArea();
 | 
	
		
			
				|  |  | -            if (hasAdHocRow) rowSplitCnt++;
 | 
	
		
			
				|  |  | -            if (hasAdHocCol) colSplitCnt++;
 | 
	
		
			
				|  |  | -            //2.2
 | 
	
		
			
				|  |  | -            for (let colIdx = 0; colIdx < colSplitCnt; colIdx++) {
 | 
	
		
			
				|  |  | -                pageStatus[JV.STATUS_CROSS_COL_END] = colIdx == (colSplitCnt - 1)?true:false;
 | 
	
		
			
				|  |  | +            for (let segIdx = 0; segIdx < segCnt; segIdx++) {
 | 
	
		
			
				|  |  | +                if (segIdx === segCnt - 1) {
 | 
	
		
			
				|  |  | +                    pageStatus[JV.STATUS_REPORT_END] = true;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (segIdx > 0) {
 | 
	
		
			
				|  |  | +                    pageStatus[JV.STATUS_REPORT_START] = false;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                me.pageStatusLst.push(pageStatus.slice(0));
 | 
	
		
			
				|  |  | +                pageIdx++;
 | 
	
		
			
				|  |  | +                private_addTabValue(me.dispValueIdxLst_Row, me.sortedRowSequence, segIdx, 0, me.sortedRowSequence[segIdx].length, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
 | 
	
		
			
				|  |  | +                private_addTabValue(me.dispValueIdxLst_Col, me.sortedColSequence, segIdx, 0, me.sortedColSequence[segIdx].length, null, null, null);
 | 
	
		
			
				|  |  | +                private_addContentValue(me.dispValueIdxLst_Content, me.sortedContentSequence, segIdx, 0, me.sortedRowSequence[segIdx].length, 0, me.sortedColSequence[segIdx].length, me.page_seg_map, pageIdx);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //*/
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            for (let segIdx = 0; segIdx < segCnt; segIdx++) {
 | 
	
		
			
				|  |  | +                //2.1. seg level initialize
 | 
	
		
			
				|  |  | +                private_resetBandArea();
 | 
	
		
			
				|  |  | +                let orgMaxRowRec = maxRowRec, orgMaxColRec = maxColRec;
 | 
	
		
			
				|  |  | +                let rowSplitCnt = Math.ceil(1.0 * me.sortedRowSequence[segIdx].length / maxRowRec);
 | 
	
		
			
				|  |  | +                let colSplitCnt = Math.ceil(1.0 * me.sortedColSequence[segIdx].length / maxColRec);
 | 
	
		
			
				|  |  | +                pageStatus[JV.STATUS_CROSS_ROW_END] = true;
 | 
	
		
			
				|  |  |                  private_resetBandArea();
 | 
	
		
			
				|  |  | -                counterColRec = orgMaxColRec * colIdx;
 | 
	
		
			
				|  |  | -                let currentSortedContentSequence = me.sortedContentSequence;
 | 
	
		
			
				|  |  | -                let currentSortedColSequence = me.sortedColSequence;
 | 
	
		
			
				|  |  | -                if (hasAdHocCol && colIdx == (colSplitCnt - 1)) {
 | 
	
		
			
				|  |  | -                    currentSortedColSequence = null;
 | 
	
		
			
				|  |  | -                    currentSortedContentSequence = null;
 | 
	
		
			
				|  |  | -                    counterColRec = 0;
 | 
	
		
			
				|  |  | +                let hasAdHocRow = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_ROW_SUM, rptTpl, bands, me.sortedRowSequence, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
 | 
	
		
			
				|  |  | +                if (hasAdHocRow) {
 | 
	
		
			
				|  |  | +                    hasAdHocRow = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_ROW_EXT, rptTpl, bands, me.sortedRowSequence, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
 | 
	
		
			
				|  |  | -                    pageStatus[JV.STATUS_CROSS_ROW_END] = rowIdx == (rowSplitCnt - 1)?true:false;
 | 
	
		
			
				|  |  | +                pageStatus[JV.STATUS_CROSS_ROW_END] = false;
 | 
	
		
			
				|  |  | +                pageStatus[JV.STATUS_CROSS_COL_END] = true;
 | 
	
		
			
				|  |  | +                private_resetBandArea();
 | 
	
		
			
				|  |  | +                let hasAdHocCol = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_COL_SUM, rptTpl, bands, me.sortedColSequence, segIdx, (colSplitCnt - 1) * orgMaxColRec, maxColRec);
 | 
	
		
			
				|  |  | +                pageStatus[JV.STATUS_CROSS_COL_END] = false;
 | 
	
		
			
				|  |  | +                private_resetBandArea();
 | 
	
		
			
				|  |  | +                if (hasAdHocRow) rowSplitCnt++;
 | 
	
		
			
				|  |  | +                if (hasAdHocCol) colSplitCnt++;
 | 
	
		
			
				|  |  | +                //2.2
 | 
	
		
			
				|  |  | +                for (let colIdx = 0; colIdx < colSplitCnt; colIdx++) {
 | 
	
		
			
				|  |  | +                    pageStatus[JV.STATUS_CROSS_COL_END] = (colIdx === (colSplitCnt - 1));
 | 
	
		
			
				|  |  |                      private_resetBandArea();
 | 
	
		
			
				|  |  | -                    me.pageStatusLst.push(pageStatus.slice(0));
 | 
	
		
			
				|  |  | -                    pageIdx++;
 | 
	
		
			
				|  |  | -                    counterRowRec = orgMaxRowRec * rowIdx;
 | 
	
		
			
				|  |  | -                    let currentSortedRowSequence = me.sortedRowSequence;
 | 
	
		
			
				|  |  | -                    if (hasAdHocRow && rowIdx == (rowSplitCnt - 1)) {
 | 
	
		
			
				|  |  | -                        currentSortedRowSequence = null;
 | 
	
		
			
				|  |  | +                    counterColRec = orgMaxColRec * colIdx;
 | 
	
		
			
				|  |  | +                    let currentSortedContentSequence = me.sortedContentSequence;
 | 
	
		
			
				|  |  | +                    let currentSortedColSequence = me.sortedColSequence;
 | 
	
		
			
				|  |  | +                    if (hasAdHocCol && colIdx === (colSplitCnt - 1)) {
 | 
	
		
			
				|  |  | +                        currentSortedColSequence = null;
 | 
	
		
			
				|  |  |                          currentSortedContentSequence = null;
 | 
	
		
			
				|  |  | -                        counterRowRec = 0;
 | 
	
		
			
				|  |  | +                        counterColRec = 0;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
 | 
	
		
			
				|  |  | +                        pageStatus[JV.STATUS_CROSS_ROW_END] = (rowIdx === (rowSplitCnt - 1));
 | 
	
		
			
				|  |  | +                        private_resetBandArea();
 | 
	
		
			
				|  |  | +                        me.pageStatusLst.push(pageStatus.slice(0));
 | 
	
		
			
				|  |  | +                        pageIdx++;
 | 
	
		
			
				|  |  | +                        counterRowRec = orgMaxRowRec * rowIdx;
 | 
	
		
			
				|  |  | +                        let currentSortedRowSequence = me.sortedRowSequence;
 | 
	
		
			
				|  |  | +                        if (hasAdHocRow && rowIdx === (rowSplitCnt - 1)) {
 | 
	
		
			
				|  |  | +                            currentSortedRowSequence = null;
 | 
	
		
			
				|  |  | +                            currentSortedContentSequence = null;
 | 
	
		
			
				|  |  | +                            counterRowRec = 0;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        private_addTabValue(me.dispValueIdxLst_Row, currentSortedRowSequence, segIdx, counterRowRec, maxRowRec, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
 | 
	
		
			
				|  |  | +                        private_addTabValue(me.dispValueIdxLst_Col, currentSortedColSequence, segIdx, counterColRec, maxColRec, null, null, null);
 | 
	
		
			
				|  |  | +                        private_addContentValue(me.dispValueIdxLst_Content, currentSortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, me.page_seg_map, pageIdx);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    private_addTabValue(me.dispValueIdxLst_Row, currentSortedRowSequence, segIdx, counterRowRec, maxRowRec, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
 | 
	
		
			
				|  |  | -                    private_addTabValue(me.dispValueIdxLst_Col, currentSortedColSequence, segIdx, counterColRec, maxColRec, null, null, null);
 | 
	
		
			
				|  |  | -                    private_addContentValue(me.dispValueIdxLst_Content, currentSortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, me.page_seg_map, pageIdx);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +                JpcCrossTabHelper.initialPageStatus(pageStatus);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            JpcCrossTabHelper.initialPageStatus(pageStatus);
 | 
	
		
			
				|  |  | +            //3. set pageSeq and return the result
 | 
	
		
			
				|  |  | +            rst = pageIdx;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          bands = null;
 | 
	
		
			
				|  |  | -        //3. set pageSeq and return the result
 | 
	
		
			
				|  |  | -        rst = pageIdx;
 | 
	
		
			
				|  |  |          return rst;
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      JpcCrossTabResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, page, bands, controls, $CURRENT_RPT) {
 | 
	
		
			
				|  |  |          let me = this, rst = [], tabRstLst = [];
 | 
	
		
			
				|  |  | -        let segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
 | 
	
		
			
				|  |  | -        //1 calculate the band position
 | 
	
		
			
				|  |  | -        JpcBandHelper.setBandArea(bands, rptTpl, me.pageStatusLst[page - 1]);
 | 
	
		
			
				|  |  | -        //2. start to output detail-part
 | 
	
		
			
				|  |  |          let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
 | 
	
		
			
				|  |  | -        //2.1 Row-Tab
 | 
	
		
			
				|  |  | -        tabRstLst.push(me.outputRowTab(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | -        //2.2 Col-Tab
 | 
	
		
			
				|  |  | -        tabRstLst.push(me.outputColTab(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | -        //2.3 Content-Tab
 | 
	
		
			
				|  |  | -        tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | -        //2.4 Sum-Tab Row
 | 
	
		
			
				|  |  | -        //2.4 Sum-tab Col
 | 
	
		
			
				|  |  | -        tabRstLst.push(me.outputTabSum(rptTpl, dataObj, page, bands, unitFactor, JV.NODE_CROSS_COL_SUM, controls));
 | 
	
		
			
				|  |  | -        //2.x row tab ext
 | 
	
		
			
				|  |  | -        tabRstLst.push(me.outputTabExt(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | -        tabRstLst.push(me.outputSumTabExt(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls));
 | 
	
		
			
				|  |  | -        //2.5 Discrete
 | 
	
		
			
				|  |  | -        tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT));
 | 
	
		
			
				|  |  | +        if (me.paging_option === JV.PAGING_OPTION_INFINITY) {
 | 
	
		
			
				|  |  | +            /*
 | 
	
		
			
				|  |  | +            let segIdx = page - 1;
 | 
	
		
			
				|  |  | +            //1 calculate the band position
 | 
	
		
			
				|  |  | +            JpcBandHelper.setBandArea(bands, rptTpl, me.pageStatusLst[page - 1]);
 | 
	
		
			
				|  |  | +            //2. then reset the band height
 | 
	
		
			
				|  |  | +            let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
 | 
	
		
			
				|  |  | +            let crossContentBand = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  | +            let actH = JpcCrossTabHelper.getActualRowsHeight(bands, rptTpl, me.sortedRowSequence, page);
 | 
	
		
			
				|  |  | +            let actW = JpcCrossTabHelper.getActualColsWidth(bands, rptTpl, me.sortedColSequence, page);
 | 
	
		
			
				|  |  | +            let offsetY = actH - (crossContentBand.Bottom - crossContentBand.Top);
 | 
	
		
			
				|  |  | +            let offsetX = actW - (crossContentBand.Right - crossContentBand.Left);
 | 
	
		
			
				|  |  | +            JpcBandHelper.resetBandPos(rptTpl[JV.NODE_BAND_COLLECTION], bands, crossContentBand, offsetX, offsetY);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //2.1 Row-Tab
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputRowTab(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            //2.2 Col-Tab
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputColTab(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            //2.3 Content-Tab
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            //2.4 Sum-Tab Row
 | 
	
		
			
				|  |  | +            //2.4 Sum-tab Col
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputTabSum(rptTpl, dataObj, page, bands, unitFactor, JV.NODE_CROSS_COL_SUM, controls));
 | 
	
		
			
				|  |  | +            //2.x row tab ext
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputTabExt(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputSumTabExt(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls));
 | 
	
		
			
				|  |  | +            //2.5 Discrete
 | 
	
		
			
				|  |  | +            tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT));
 | 
	
		
			
				|  |  | +            //*/
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            let segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
 | 
	
		
			
				|  |  | +            //1 calculate the band position
 | 
	
		
			
				|  |  | +            JpcBandHelper.setBandArea(bands, rptTpl, me.pageStatusLst[page - 1]);
 | 
	
		
			
				|  |  | +            //2. start to output detail-part
 | 
	
		
			
				|  |  | +            //2.1 Row-Tab
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputRowTab(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            //2.2 Col-Tab
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputColTab(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            //2.3 Content-Tab
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            //2.4 Sum-Tab Row
 | 
	
		
			
				|  |  | +            //2.4 Sum-tab Col
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputTabSum(rptTpl, dataObj, page, bands, unitFactor, JV.NODE_CROSS_COL_SUM, controls));
 | 
	
		
			
				|  |  | +            //2.x row tab ext
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputTabExt(rptTpl, dataObj, page, bands, unitFactor, controls));
 | 
	
		
			
				|  |  | +            tabRstLst.push(me.outputSumTabExt(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls));
 | 
	
		
			
				|  |  | +            //2.5 Discrete
 | 
	
		
			
				|  |  | +            tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          for (let i = 0; i < tabRstLst.length; i++) {
 | 
	
		
			
				|  |  |              rst = rst.concat(tabRstLst[i]);
 | 
	
		
			
				|  |  |              tabRstLst[i] = null;
 | 
	
	
		
			
				|  | @@ -329,7 +384,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          let band = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  |          if (band) {
 | 
	
		
			
				|  |  |              let pageStatus = me.pageStatusLst[page - 1];
 | 
	
		
			
				|  |  | -            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
 | 
	
		
			
				|  |  | +            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
 | 
	
		
			
				|  |  |                  let tab_fields = tab[JV.TAB_CROSS_FIELDS];
 | 
	
		
			
				|  |  |                  let data_details = dataObj[JV.DATA_DETAIL_DATA];
 | 
	
		
			
				|  |  |                  let valuesIdx = me.dispValueIdxLst_Row[page - 1];
 | 
	
	
		
			
				|  | @@ -354,7 +409,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          let band = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  |          if (band) {
 | 
	
		
			
				|  |  |              let pageStatus = me.pageStatusLst[page - 1];
 | 
	
		
			
				|  |  | -            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
 | 
	
		
			
				|  |  | +            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
 | 
	
		
			
				|  |  |                  let tab_fields = tab[JV.TAB_CROSS_FIELDS];
 | 
	
		
			
				|  |  |                  let data_details = dataObj[JV.DATA_DETAIL_DATA];
 | 
	
		
			
				|  |  |                  let valuesIdx = me.dispValueIdxLst_Col[page - 1];
 | 
	
	
		
			
				|  | @@ -390,7 +445,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          let band = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  |          if (band) {
 | 
	
		
			
				|  |  |              let pageStatus = me.pageStatusLst[page - 1];
 | 
	
		
			
				|  |  | -            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
 | 
	
		
			
				|  |  | +            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
 | 
	
		
			
				|  |  |                  let tab_fields = tab[JV.TAB_CROSS_FIELDS];
 | 
	
		
			
				|  |  |                  let data_details = dataObj[JV.DATA_DETAIL_DATA];
 | 
	
		
			
				|  |  |                  let contentValuesIdx = me.dispValueIdxLst_Content[page - 1];
 | 
	
	
		
			
				|  | @@ -417,10 +472,10 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |              band = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  |          if (band) {
 | 
	
		
			
				|  |  |              let pageStatus = me.pageStatusLst[page - 1];
 | 
	
		
			
				|  |  | -            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
 | 
	
		
			
				|  |  | +            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
 | 
	
		
			
				|  |  |                  let tab_fields = tab[JV.TAB_CROSS_FIELDS];
 | 
	
		
			
				|  |  |                  for (let i = 0; i < me.dispSumValueLst_Col[page - 1].length; i++) {
 | 
	
		
			
				|  |  | -                    if (me.dispSumValueLst_Col[page - 1][i] != null) {
 | 
	
		
			
				|  |  | +                    if (me.dispSumValueLst_Col[page - 1][i] !== null) {
 | 
	
		
			
				|  |  |                          for (let j = 0; j < me.dispSumValueLst_Col[page - 1][i].length; j++) {
 | 
	
		
			
				|  |  |                              let tab_field = tab_fields[j];
 | 
	
		
			
				|  |  |                              let val = me.dispSumValueLst_Col[page - 1][i][j];
 | 
	
	
		
			
				|  | @@ -431,7 +486,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |                      } else {
 | 
	
		
			
				|  |  |                          let sumL = 1;
 | 
	
		
			
				|  |  |                          for (let si = 0; si < me.dispSumValueLst_Col.length; si++) {
 | 
	
		
			
				|  |  | -                            if (me.dispSumValueLst_Col[si][0] != null) {
 | 
	
		
			
				|  |  | +                            if (me.dispSumValueLst_Col[si][0] !== null) {
 | 
	
		
			
				|  |  |                                  sumL = me.dispSumValueLst_Col[si][0].length;
 | 
	
		
			
				|  |  |                                  break;
 | 
	
		
			
				|  |  |                              }
 | 
	
	
		
			
				|  | @@ -455,7 +510,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          let band = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  |          if (band) {
 | 
	
		
			
				|  |  |              let pageStatus = me.pageStatusLst[page - 1];
 | 
	
		
			
				|  |  | -            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
 | 
	
		
			
				|  |  | +            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
 | 
	
		
			
				|  |  |                  let tab_fields = tab[JV.TAB_CROSS_FIELDS],
 | 
	
		
			
				|  |  |                      data_details = dataObj[JV.DATA_DETAIL_DATA],
 | 
	
		
			
				|  |  |                      valuesIdx = me.dispValueIdxLst_Col[page - 1];
 | 
	
	
		
			
				|  | @@ -491,7 +546,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          let band = bands[tab[JV.PROP_BAND_NAME]];
 | 
	
		
			
				|  |  |          if (band) {
 | 
	
		
			
				|  |  |              let pageStatus = me.pageStatusLst[page - 1];
 | 
	
		
			
				|  |  | -            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true && pageStatus[JV.STATUS_CROSS_ROW_END] === true) {
 | 
	
		
			
				|  |  | +            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true && pageStatus[JV.STATUS_CROSS_ROW_END] === true) {
 | 
	
		
			
				|  |  |                  let tab_fields = tab[JV.TAB_CROSS_FIELDS],
 | 
	
		
			
				|  |  |                      data_details = dataObj[JV.DATA_DETAIL_DATA],
 | 
	
		
			
				|  |  |                      data_fields = [];
 | 
	
	
		
			
				|  | @@ -533,22 +588,24 @@ JpcCrossTabSrv.prototype.createNew = function(){
 | 
	
		
			
				|  |  |          return rst;
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      JpcCrossTabResult.outputTabField = function (band, tab_field, data_field, valueIdx, serialIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls) {
 | 
	
		
			
				|  |  | -        let me = this, rst = null;
 | 
	
		
			
				|  |  | -        if (isRow == true && tab_field[JV.PROP_IS_SERIAL] && tab_field[JV.PROP_IS_SERIAL] == true) {
 | 
	
		
			
				|  |  | -            if (serialIdx >= 0) rst = JpcCommonOutputHelper.createCommonOutput(tab_field, serialIdx + 1)
 | 
	
		
			
				|  |  | -            else rst = JpcCommonOutputHelper.createCommonOutput(tab_field, "", controls);
 | 
	
		
			
				|  |  | +        let rst = null;
 | 
	
		
			
				|  |  | +        if (isRow === true && tab_field[JV.PROP_IS_SERIAL] && tab_field[JV.PROP_IS_SERIAL] === true) {
 | 
	
		
			
				|  |  | +            if (serialIdx >= 0) {
 | 
	
		
			
				|  |  | +                rst = JpcCommonOutputHelper.createCommonOutput(tab_field, serialIdx + 1)
 | 
	
		
			
				|  |  | +            } else rst = JpcCommonOutputHelper.createCommonOutput(tab_field, "", controls);
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              rst = JpcCommonOutputHelper.createCommonOutput(tab_field, JpcFieldHelper.getValue(data_field, valueIdx), controls);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //position
 | 
	
		
			
				|  |  | -        if (isRow == true) {
 | 
	
		
			
				|  |  | +        if (isRow === true) {
 | 
	
		
			
				|  |  |              rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, 1, 0, true, false);
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |              rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, 1, 0, false, false);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return rst;
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      return JpcCrossTabResult;
 | 
	
		
			
				|  |  | -}
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  module.exports = new JpcCrossTabSrv();
 |