@syncfusion/ej2-pivotview 20.1.57 → 20.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5115,6 +5115,7 @@ class PivotEngine {
5115
5115
  isNaN(value) && !isNullOrUndefined(value) &&
5116
5116
  (['PopulationStDev', 'SampleStDev', 'PopulationVar', 'SampleVar']).indexOf(aggregate) !== -1) {
5117
5117
  formattedText = '#DIV/0!';
5118
+ value = 0;
5118
5119
  }
5119
5120
  //dln = data[tnum].length;
5120
5121
  formattedText = (cellDetails.skipFormatting ? isNullOrUndefined(value) ?
@@ -9052,6 +9053,12 @@ class Render {
9052
9053
  }
9053
9054
  }
9054
9055
  else {
9056
+ if ((['PercentageOfDifferenceFrom', 'PercentageOfRowTotal', 'PercentageOfColumnTotal', 'PercentageOfGrandTotal', 'PercentageOfParentRowTotal', 'PercentageOfParentColumnTotal', 'PercentageOfParentTotal']).indexOf(field.type) > -1) {
9057
+ format = 'P2';
9058
+ }
9059
+ else if (['PopulationStDev', 'SampleStDev', 'PopulationVar', 'SampleVar', 'Index'].indexOf(field.type) > -1) {
9060
+ format = undefined;
9061
+ }
9055
9062
  if (this.parent.dataSourceSettings.formatSettings.length > 0) {
9056
9063
  for (let fCnt = 0; fCnt < this.parent.dataSourceSettings.formatSettings.length; fCnt++) {
9057
9064
  let formatSettings = this.parent.dataSourceSettings.formatSettings[fCnt];
@@ -9146,12 +9153,18 @@ class Render {
9146
9153
  else {
9147
9154
  this.colPos++;
9148
9155
  /* eslint-disable-next-line */
9149
- if (isNullOrUndefined(args.data[this.colPos].value) || isNullOrUndefined(args.data[this.colPos].formattedText) || args.data[this.colPos].formattedText === "") {
9156
+ let pivotValue = args.data[this.colPos];
9157
+ if (isNullOrUndefined(pivotValue.value) || isNullOrUndefined(pivotValue.formattedText) || pivotValue.formattedText === "") {
9150
9158
  args.value = this.parent.exportType === 'Excel' ? null : '';
9151
9159
  }
9152
9160
  else {
9153
- /* eslint-disable-next-line */
9154
- args.value = !isNullOrUndefined(args.data[this.colPos].value) ? args.data[this.colPos].value : args.data[this.colPos].formattedText;
9161
+ let aggMatrix = this.parent.engineModule.aggregatedValueMatrix;
9162
+ if (aggMatrix[pivotValue.rowIndex] && aggMatrix[pivotValue.rowIndex][pivotValue.colIndex]) {
9163
+ args.value = aggMatrix[pivotValue.rowIndex][pivotValue.colIndex];
9164
+ }
9165
+ else {
9166
+ args.value = !isNullOrUndefined(pivotValue.value) ? (pivotValue.formattedText === '#DIV/0!' ? pivotValue.formattedText : pivotValue.value) : pivotValue.formattedText;
9167
+ }
9155
9168
  }
9156
9169
  }
9157
9170
  args = this.exportContentEvent(args);
@@ -26887,7 +26900,8 @@ class ExcelExport$1 {
26887
26900
  let styles = (pivotCell.axis == 'row') ? { hAlign: 'Left', bold: true, wrapText: true } : { numberFormat: formatList[field], bold: false, wrapText: true };
26888
26901
  let headerStyle = { bold: true, vAlign: 'Center', wrapText: true, indent: cCnt === 0 ? pivotCell.level * 10 : 0 };
26889
26902
  if (!(pivotCell.level === -1 && !pivotCell.rowSpan)) {
26890
- let cellValue = pivotCell.axis === 'value' ? pivotCell.value : pivotCell.formattedText;
26903
+ let aggMatrix = this.parent.engineModule.aggregatedValueMatrix;
26904
+ let cellValue = pivotCell.axis === 'value' ? ((aggMatrix[rCnt] && aggMatrix[rCnt][cCnt]) ? aggMatrix[rCnt][cCnt] : (pivotCell.formattedText === '#DIV/0!' ? pivotCell.formattedText : pivotCell.value)) : pivotCell.formattedText;
26891
26905
  let isgetValuesHeader = ((this.parent.dataSourceSettings.rows.length === 0 && this.parent.dataSourceSettings.valueAxis === 'row')
26892
26906
  || (this.parent.dataSourceSettings.columns.length === 0 && this.parent.dataSourceSettings.valueAxis === 'column'));
26893
26907
  if (pivotCell.type === 'grand sum' && !(this.parent.dataSourceSettings.values.length === 1 && this.parent.dataSourceSettings.valueAxis === 'row' && pivotCell.axis === 'column')) {