Commit 4e13d96e authored by Alexander.Trofimov's avatar Alexander.Trofimov

update row name

parent 9c4fed69
...@@ -4947,19 +4947,30 @@ ...@@ -4947,19 +4947,30 @@
var countC = pivotTable.getColumnFieldsCount(); var countC = pivotTable.getColumnFieldsCount();
var countR = pivotTable.getRowFieldsCount(true); var countR = pivotTable.getRowFieldsCount(true);
var c1 = pivotRange.c1; var c1 = pivotRange.c1;
var start = pivotRange.r1 + countC; var r1 = pivotRange.r1 + countC;
cells = this.getRange4(start, c1);
cells.setValue('Row Labels');
++start;
var setRow = false;
for (i = 0; i < rowFields.length; ++i) { for (i = 0; i < rowFields.length; ++i) {
if (0 === i) {
cells = this.getRange4(r1, c1);
cells.setValue('Row Labels');
}
index = rowFields[i].asc_getIndex();
field = pivotFields[index];
if (setRow) {
cells = this.getRange4(r1, c1);
cells.setValue(pivotFields[index].asc_getName() || cacheFields[index].asc_getName());
setRow = false;
}
rowFieldsPos[i] = c1; rowFieldsPos[i] = c1;
field = pivotFields[rowFields[i].asc_getIndex()];
if (field && false === field.compact) { if (field && false === field.compact) {
++c1; ++c1;
setRow = true;
} }
} }
++r1;
var rowItem, rowItems = pivotTable.getRowItems(); var rowItem, rowItems = pivotTable.getRowItems();
if (rowItems) { if (rowItems) {
for (i = 0; i < rowItems.length; ++i) { for (i = 0; i < rowItems.length; ++i) {
...@@ -4973,7 +4984,7 @@ ...@@ -4973,7 +4984,7 @@
sharedItem = cacheFields[indexField].getSharedItem(cacheIndex.x); sharedItem = cacheFields[indexField].getSharedItem(cacheIndex.x);
v = sharedItem.v; v = sharedItem.v;
} }
cells = this.getRange4(start + i, rowFieldsPos[rowItem.getR()]); cells = this.getRange4(r1 + i, rowFieldsPos[rowItem.getR()]);
cells.setValue(v); cells.setValue(v);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment