@@ -47,8 +47,8 @@ import { IgxHierarchicalGridExportComponent,
4747import { IgxHierarchicalGridComponent } from '../../grids/hierarchical-grid/public_api' ;
4848import { IgxHierarchicalRowComponent } from '../../grids/hierarchical-grid/hierarchical-row.component' ;
4949import { 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' ;
5252
5353describe ( 'Excel Exporter' , ( ) => {
5454 let exporter : IgxExcelExporterService ;
@@ -1461,7 +1461,7 @@ describe('Excel Exporter', () => {
14611461 let grid : IgxPivotGridComponent ;
14621462
14631463 beforeEach ( waitForAsync ( ( ) => {
1464- options = createExportOptions ( 'PivotGridGridExcelExport ' ) ;
1464+ options = createExportOptions ( 'PivotGridExcelExport ' ) ;
14651465 } ) ) ;
14661466
14671467 it ( 'should export pivot grid' , async ( ) => {
@@ -1486,6 +1486,80 @@ describe('Excel Exporter', () => {
14861486 await exportAndVerify ( grid , options , actualData . exportPivotGridDataWithHeaders , false ) ;
14871487 } ) ;
14881488
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+
14891563 it ( 'should export hierarchical pivot grid' , async ( ) => {
14901564 fix = TestBed . createComponent ( IgxPivotGridTestComplexHierarchyComponent ) ;
14911565 fix . detectChanges ( ) ;
0 commit comments