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