@@ -15,7 +15,9 @@ import {
1515 IgxInputGroupComponent ,
1616 IgxLabelDirective ,
1717 IgxInputDirective ,
18- IgxColumnGroupComponent
18+ IgxColumnGroupComponent ,
19+ IgxPivotGridComponent ,
20+ IgxPivotDataSelectorComponent
1921} from 'igniteui-angular' ;
2022
2123@Component ( {
@@ -28,6 +30,8 @@ import {
2830 IgxColumnGroupComponent ,
2931 IgxTreeGridComponent ,
3032 IgxHierarchicalGridComponent ,
33+ IgxPivotGridComponent ,
34+ IgxPivotDataSelectorComponent ,
3135 IgxRowIslandComponent ,
3236 IgxButtonDirective ,
3337 IgxSwitchComponent ,
@@ -52,6 +56,9 @@ export class GridPdfExportSampleComponent {
5256 @ViewChild ( 'hierarchicalGrid' , { static : true } )
5357 public hierarchicalGrid : IgxHierarchicalGridComponent ;
5458
59+ @ViewChild ( 'pivotGrid' , { static : true } )
60+ public pivotGrid : IgxPivotGridComponent ;
61+
5562 // Grid data
5663 public gridData = [
5764 { ID : 1 , Name : 'Product A' , Category : 'Electronics' , Price : 299.99 , InStock : true , LaunchDate : new Date ( 2023 , 0 , 15 ) } ,
@@ -119,6 +126,33 @@ export class GridPdfExportSampleComponent {
119126 }
120127 ] ;
121128
129+ public pivotGridData = [
130+ {
131+ ProductCategory : 'Clothing' , UnitPrice : 12.81 , SellerName : 'Stanley' ,
132+ Country : 'Bulgaria' , City : 'Sofia' , Date : '01/01/2021' , UnitsSold : 282
133+ } ,
134+ {
135+ ProductCategory : 'Clothing' , UnitPrice : 49.57 , SellerName : 'Elisa' ,
136+ Country : 'USA' , City : 'New York' , Date : '01/05/2019' , UnitsSold : 296
137+ } ,
138+ {
139+ ProductCategory : 'Bikes' , UnitPrice : 3.56 , SellerName : 'Lydia' ,
140+ Country : 'Uruguay' , City : 'Ciudad de la Costa' , Date : '01/06/2020' , UnitsSold : 68
141+ } ,
142+ {
143+ ProductCategory : 'Accessories' , UnitPrice : 85.58 , SellerName : 'David' ,
144+ Country : 'USA' , City : 'New York' , Date : '04/07/2021' , UnitsSold : 293
145+ } ,
146+ {
147+ ProductCategory : 'Components' , UnitPrice : 18.13 , SellerName : 'John' ,
148+ Country : 'USA' , City : 'New York' , Date : '12/08/2021' , UnitsSold : 240
149+ } ,
150+ {
151+ ProductCategory : 'Clothing' , UnitPrice : 68.33 , SellerName : 'Larry' ,
152+ Country : 'Uruguay' , City : 'Ciudad de la Costa' , Date : '05/12/2020' , UnitsSold : 456
153+ }
154+ ] ;
155+
122156 // Export options
123157 public fileName = 'GridExport' ;
124158 public pageOrientation : 'portrait' | 'landscape' = 'landscape' ;
@@ -144,6 +178,12 @@ export class GridPdfExportSampleComponent {
144178 this . pdfExporter . export ( this . hierarchicalGrid , options ) ;
145179 }
146180
181+ public exportPivotGrid ( ) {
182+ const options = this . createExportOptions ( ) ;
183+ options . fileName = `PivotGrid_${ this . fileName } ` ;
184+ this . pdfExporter . export ( this . pivotGrid , options ) ;
185+ }
186+
147187 private createExportOptions ( ) : IgxPdfExporterOptions {
148188 const options = new IgxPdfExporterOptions ( this . fileName ) ;
149189 options . pageOrientation = this . pageOrientation ;
0 commit comments