|
@@ -456,10 +456,10 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
|
|
|
//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));
|
|
|
+ tabRstLst.push(me.outputTabSum(rptTpl, dataObj, page, bands, unitFactor, JV.NODE_CROSS_COL_SUM, controls, $CURRENT_RPT, customizeCfg));
|
|
|
//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));
|
|
|
+ tabRstLst.push(me.outputTabExt(rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg));
|
|
|
+ tabRstLst.push(me.outputSumTabExt(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls, $CURRENT_RPT, customizeCfg));
|
|
|
//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, customizeCfg));
|
|
|
}
|
|
@@ -616,7 +616,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
return rst;
|
|
|
};
|
|
|
- JpcCrossTabResult.outputTabSum = function (rptTpl, dataObj, page, bands, unitFactor, tabNodeName, controls) {
|
|
|
+ JpcCrossTabResult.outputTabSum = function (rptTpl, dataObj, page, bands, unitFactor, tabNodeName, controls, $CURRENT_RPT, customizeCfg) {
|
|
|
let me = this, rst = [],
|
|
|
tab = rptTpl[JV.NODE_CROSS_INFO][tabNodeName],
|
|
|
band = bands[tab[JV.PROP_BAND_NAME]];
|
|
@@ -625,6 +625,12 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] === true) {
|
|
|
let tab_fields = tab[JV.PROP_CROSS_FIELDS];
|
|
|
for (let i = 0; i < me.dispSumValueLst_Col[page - 1].length; i++) {
|
|
|
+ if (i === 0) {
|
|
|
+ for (let tfIdx = 0; tfIdx < tab_fields.length; tfIdx++) {
|
|
|
+ let map_data_field = JE.F(tab_fields[tfIdx][JV.PROP_FIELD_ID], $CURRENT_RPT);
|
|
|
+ JpcFieldHelper.resetFormat(tab_fields[tfIdx], map_data_field, customizeCfg);
|
|
|
+ }
|
|
|
+ }
|
|
|
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];
|
|
@@ -654,7 +660,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
return rst;
|
|
|
};
|
|
|
- JpcCrossTabResult.outputTabExt = function (rptTpl, dataObj, page, bands, unitFactor, controls) {
|
|
|
+ JpcCrossTabResult.outputTabExt = function (rptTpl, dataObj, page, bands, unitFactor, controls, $CURRENT_RPT, customizeCfg) {
|
|
|
let me = this, rst = [], firstTextOutput = true,
|
|
|
tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT];
|
|
|
let band = bands[tab[JV.PROP_BAND_NAME]];
|
|
@@ -666,10 +672,20 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
valuesIdx = me.dispValueIdxLst_Col[page - 1];
|
|
|
for (let i = 0; i < me.row_extension_fields_idx.length; i++) {
|
|
|
let tab_field = tab_fields[i];
|
|
|
- let data_field = data_details[me.row_extension_fields_idx[i]];
|
|
|
+ let data_field = null;
|
|
|
+ let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
|
|
|
+ if (typeof me.row_extension_fields_idx[i] !== 'object') {
|
|
|
+ data_field = data_details[me.row_extension_fields_idx[i]];
|
|
|
+ } else {
|
|
|
+ if (map_data_field) {
|
|
|
+ data_field = map_data_field[JV.PROP_AD_HOC_DATA];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!(tab_field[JV.PROP_HIDDEN])) {
|
|
|
let cols = valuesIdx.length;
|
|
|
for (let colIdx = 0; colIdx < cols; colIdx++) {
|
|
|
+ if (colIdx === 0) JpcFieldHelper.resetFormat(tab_field, map_data_field, customizeCfg);
|
|
|
rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
|
|
|
//2. output texts if has
|
|
|
if (firstTextOutput) {
|
|
@@ -690,7 +706,7 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
return rst;
|
|
|
};
|
|
|
- JpcCrossTabResult.outputSumTabExt = function (rptTpl, dataObj, page, bands, unitFactor, segIdx, controls) {
|
|
|
+ JpcCrossTabResult.outputSumTabExt = function (rptTpl, dataObj, page, bands, unitFactor, segIdx, controls, $CURRENT_RPT, customizeCfg) {
|
|
|
let me = this, rst = [],
|
|
|
tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT];
|
|
|
let band = bands[tab[JV.PROP_BAND_NAME]];
|
|
@@ -701,7 +717,18 @@ JpcCrossTabSrv.prototype.createNew = function(){
|
|
|
data_details = dataObj[JV.DATA_DETAIL_DATA],
|
|
|
data_fields = [];
|
|
|
for (let i = 0; i < me.row_sum_extension_fields_idx.length; i++) {
|
|
|
- let data_field = data_details[me.row_sum_extension_fields_idx[i]];
|
|
|
+ // let data_field = data_details[me.row_sum_extension_fields_idx[i]];
|
|
|
+ let tab_field = tab_fields[i];
|
|
|
+ let data_field = null;
|
|
|
+ let map_data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
|
|
|
+ if (typeof me.row_sum_extension_fields_idx[i] !== 'object') {
|
|
|
+ data_field = data_details[me.row_sum_extension_fields_idx[i]];
|
|
|
+ } else {
|
|
|
+ if (map_data_field) {
|
|
|
+ data_field = map_data_field[JV.PROP_AD_HOC_DATA];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ JpcFieldHelper.resetFormat(tab_field, map_data_field, customizeCfg);
|
|
|
data_fields.push(data_field);
|
|
|
}
|
|
|
//2. initialize grand total value
|