@@ -47,8 +47,8 @@ import { IgxHierarchicalGridExportComponent,
47
47
import { IgxHierarchicalGridComponent } from '../../grids/hierarchical-grid/public_api' ;
48
48
import { IgxHierarchicalRowComponent } from '../../grids/hierarchical-grid/hierarchical-row.component' ;
49
49
import { GridFunctions } from '../../test-utils/grid-functions.spec' ;
50
- import { IgxPivotGridMultipleRowComponent , IgxPivotGridTestComplexHierarchyComponent } from '../../test-utils/pivot-grid-samples.spec' ;
51
- import { IgxPivotGridComponent , PivotRowLayoutType } from '../../grids/pivot-grid/public_api' ;
50
+ import { IgxPivotGridMultipleRowComponent , IgxPivotGridTestComplexHierarchyComponent , SALES_DATA } from '../../test-utils/pivot-grid-samples.spec' ;
51
+ import { IgxPivotGridComponent , IgxPivotNumericAggregate , PivotRowLayoutType } from '../../grids/pivot-grid/public_api' ;
52
52
53
53
describe ( 'Excel Exporter' , ( ) => {
54
54
let exporter : IgxExcelExporterService ;
@@ -1461,7 +1461,7 @@ describe('Excel Exporter', () => {
1461
1461
let grid : IgxPivotGridComponent ;
1462
1462
1463
1463
beforeEach ( waitForAsync ( ( ) => {
1464
- options = createExportOptions ( 'PivotGridGridExcelExport ' ) ;
1464
+ options = createExportOptions ( 'PivotGridExcelExport ' ) ;
1465
1465
} ) ) ;
1466
1466
1467
1467
it ( 'should export pivot grid' , async ( ) => {
@@ -1486,6 +1486,80 @@ describe('Excel Exporter', () => {
1486
1486
await exportAndVerify ( grid , options , actualData . exportPivotGridDataWithHeaders , false ) ;
1487
1487
} ) ;
1488
1488
1489
+ it ( 'should export pivot grid with hierarchical row dimensions.' , async ( ) => {
1490
+ fix = TestBed . createComponent ( IgxPivotGridMultipleRowComponent ) ;
1491
+ fix . detectChanges ( ) ;
1492
+
1493
+ grid = fix . componentInstance . pivotGrid ;
1494
+ fix . componentInstance . data = SALES_DATA ;
1495
+ fix . componentInstance . pivotConfigHierarchy = {
1496
+ rows : [
1497
+ {
1498
+ memberName : 'All_Srep Code Alts' ,
1499
+ enabled : true ,
1500
+ width : '150px' ,
1501
+ childLevel : {
1502
+ memberName : 'SREP_CODE_ALT' ,
1503
+ displayName : 'Srep Code Alt' ,
1504
+ sortDirection : 1 ,
1505
+ enabled : true ,
1506
+ } ,
1507
+ } ,
1508
+ {
1509
+ memberName : 'All_Srep Codes' ,
1510
+ enabled : true ,
1511
+ width : '150px' ,
1512
+ childLevel : {
1513
+ memberName : 'SREP_CODE' ,
1514
+ displayName : 'Srep Code' ,
1515
+ sortDirection : 1 ,
1516
+ enabled : true ,
1517
+ } ,
1518
+ } ,
1519
+ {
1520
+ memberName : 'All_Customers' ,
1521
+ enabled : true ,
1522
+ width : '150px' ,
1523
+ childLevel : {
1524
+ memberName : 'CUST_CODE' ,
1525
+ displayName : 'Customer' ,
1526
+ sortDirection : 1 ,
1527
+ enabled : true ,
1528
+ } ,
1529
+ }
1530
+ ] ,
1531
+ columns : [ ] ,
1532
+ values : [
1533
+ {
1534
+ member : 'JOBS' ,
1535
+ aggregate : {
1536
+ key : 'Count of Jobs' ,
1537
+ aggregator : IgxPivotNumericAggregate . count ,
1538
+ label : 'Count of Jobs' ,
1539
+ } ,
1540
+ enabled : true ,
1541
+ dataType : 'number' ,
1542
+ } ,
1543
+ {
1544
+ member : 'INV_SALES' ,
1545
+ aggregate : {
1546
+ key : 'Sum of Sales' ,
1547
+ aggregator : IgxPivotNumericAggregate . sum ,
1548
+ label : 'Sum of Sales' ,
1549
+ } ,
1550
+ enabled : true ,
1551
+ dataType : 'number' ,
1552
+ } ,
1553
+ ] ,
1554
+ filters : [ ] ,
1555
+ } ;
1556
+ grid . pivotUI . showRowHeaders = true ;
1557
+ fix . detectChanges ( ) ;
1558
+ await wait ( 300 ) ;
1559
+
1560
+ await exportAndVerify ( grid , options , actualData . exportPivotGridHierarchicalRowDimensions , false ) ;
1561
+ } ) ;
1562
+
1489
1563
it ( 'should export hierarchical pivot grid' , async ( ) => {
1490
1564
fix = TestBed . createComponent ( IgxPivotGridTestComplexHierarchyComponent ) ;
1491
1565
fix . detectChanges ( ) ;
0 commit comments