@@ -7829,6 +7829,38 @@ QUnit.module('Scenarios', moduleConfig, () => {
78297829 done();
78307830 });
78317831 });
7832+
7833+ // T1325416 - Fields with visible:false should not be exported in field headers
7834+ QUnit.test('Data fields with visible:false should not be exported in data field headers', function(assert) {
7835+ const done = assert.async();
7836+ const ds = {
7837+ fields: [
7838+ { area: 'row', dataField: 'row' },
7839+ { area: 'data', dataField: 'Sales', summaryType: 'sum', caption: 'Sales', visible: true },
7840+ { area: 'data', dataField: 'Sales2', summaryType: 'sum', caption: 'Sales2', visible: false },
7841+ { area: 'data', dataField: 'Sales3', summaryType: 'sum', caption: 'Sales3', visible: false }
7842+ ],
7843+ store: []
7844+ };
7845+ const pivotGrid = $('#pivotGrid').dxPivotGrid({ dataSource: ds }).dxPivotGrid('instance');
7846+
7847+ exportPivotGrid({
7848+ component: pivotGrid,
7849+ worksheet: this.worksheet,
7850+ topLeftCell: topLeft,
7851+ exportDataFieldHeaders: true
7852+ }).then(() => {
7853+ const dataFieldHeaderCell = this.worksheet.getRow(topLeft.row).getCell(topLeft.column);
7854+ const cellValue = dataFieldHeaderCell.value;
7855+
7856+ assert.strictEqual(cellValue, 'Sales', `Data field header should show 'Sales', got: '${cellValue}'`);
7857+
7858+ assert.ok(!cellValue.includes('Sales2'), 'Data field header should not contain Sales2');
7859+ assert.ok(!cellValue.includes('Sales3'), 'Data field header should not contain Sales3');
7860+ done();
7861+ });
7862+ });
7863+
78327864 });
78337865});
78347866
@@ -8074,7 +8106,6 @@ ExcelJSLocalizationFormatTests.runPivotGridCurrencyTests([
80748106]);
80758107ExcelJSOptionTests.runTests(moduleConfig, exportPivotGrid.__internals._getFullOptions, () => $('#pivotGrid').dxPivotGrid({}).dxPivotGrid('instance'));
80768108
8077-
80788109[
80798110 { enabled: true },
80808111 { enabled: false },
0 commit comments