Skip to content

Commit 72ac272

Browse files
committed
Multiple pivot table export samples has been added.
1 parent 02a601a commit 72ac272

24 files changed

+740
-12
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"@angular/platform-browser": "^15.1.0",
1919
"@angular/platform-browser-dynamic": "^15.1.0",
2020
"@angular/router": "^15.1.0",
21-
"@syncfusion/ej2-angular-pivotview": "^23.1.38",
21+
"@syncfusion/ej2-angular-grids": "^23.1.44",
22+
"@syncfusion/ej2-angular-pivotview": "^23.1.44",
2223
"rxjs": "~7.8.0",
2324
"tslib": "^2.3.0",
2425
"zone.js": "~0.12.0"

src/app/app-routing.module.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,20 @@ import { MultipleExportingComponent } from './multiple-exporting/multiple-export
1414
import { ChangePageSizeComponent } from './change-page-size/change-page-size.component';
1515
import { ChangeTableColumnWidthAndRowHeightComponent } from './change-column-width-and-row-height/change-column-width-and-row-height.component';
1616
import { ChangePivotTableStyleComponent } from './change-pivot-table-style/change-pivot-table-style.component';
17+
import { PivotChartExportingComponent } from './pivot-chart-exporting/pivotchart-exporting.component';
18+
import { MultiplePivotChartExportingComponent } from './multiple-pivot-chart-exporting/multiple-pivotchart-exporting.component';
19+
import { MultipleTableChartExportingComponent } from './multiple-pivottable-pivotchart-exporting/pivottable-pivotchart-exporting.component';
20+
import { ExternalTableExportingComponent } from './pivottable-with-external-table-exporting/pivottable-with-grid-exporting.component';
1721

1822
const routes: Routes = [
1923
{
2024
component:TableExportingComponent,
2125
path:''
2226
},
27+
{
28+
component:PivotChartExportingComponent,
29+
path:'pivotChartExporting'
30+
},
2331
{
2432
component:ChangeFilenameComponent,
2533
path:'changeFilename'
@@ -60,6 +68,18 @@ const routes: Routes = [
6068
component:MultipleExportingComponent,
6169
path:'multipleExport'
6270
},
71+
{
72+
component:MultiplePivotChartExportingComponent,
73+
path:'multiplePivotChartExport'
74+
},
75+
{
76+
component:MultipleTableChartExportingComponent,
77+
path:'multiplePivotTableAndChartExport'
78+
},
79+
{
80+
component:ExternalTableExportingComponent,
81+
path:'externalTableChartExport'
82+
},
6383
{
6484
component:ChangePageSizeComponent,
6585
path:'changePageSize'

src/app/app.component.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ <h1>Exporting customization</h1>
55
<li>
66
<a routerLink=''>Default exporting</a>
77
</li>
8+
<li>
9+
<a routerLink="pivotChartExporting">Pivot Chart exporting</a>
10+
</li>
811
<li>
912
<a routerLink="addingCustomFont">Add customFont</a>
1013
</li>
@@ -41,6 +44,15 @@ <h1>Exporting customization</h1>
4144
<li>
4245
<a routerLink="multipleExport">Multiple export</a>
4346
</li>
47+
<li>
48+
<a routerLink="multiplePivotChartExport">Multiple Pivot Chart export</a>
49+
</li>
50+
<li>
51+
<a routerLink="multiplePivotTableAndChartExport">Multiple Pivot Table And Chart export</a>
52+
</li>
53+
<li>
54+
<a routerLink="externalTableChartExport">Pivot Table with external Table and Chart export</a>
55+
</li>
4456
<li>
4557
<a routerLink="blobData">Blob data</a>
4658
</li>

src/app/app.module.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import { PivotViewAllModule, PivotFieldListAllModule } from '@syncfusion/ej2-angular-pivotview';
4+
import { GridAllModule } from '@syncfusion/ej2-angular-grids';
45
import { AppComponent } from './app.component';
56
import { TableExportingComponent } from './exporting/exporting.component';
7+
import { PivotChartExportingComponent } from './pivot-chart-exporting/pivotchart-exporting.component';
68
import { TableAndChartExportComponent } from './table-and-chart-export/table-and-chart-export.component';
79
import { AddHeaderAndFooterComponent } from './add-header-and-footer/add-header-and-footer.component';
810
import { ChangePageOrientationComponent } from './change-page-orientation/change-page-orientation.component';
@@ -18,6 +20,9 @@ import { ExportAllPagesComponent } from './export-all-pages/export-all-pages.com
1820
import { ChangePageSizeComponent } from './change-page-size/change-page-size.component';
1921
import { ChangeTableColumnWidthAndRowHeightComponent } from './change-column-width-and-row-height/change-column-width-and-row-height.component';
2022
import { ChangePivotTableStyleComponent } from './change-pivot-table-style/change-pivot-table-style.component';
23+
import { MultiplePivotChartExportingComponent } from './multiple-pivot-chart-exporting/multiple-pivotchart-exporting.component';
24+
import { MultipleTableChartExportingComponent } from './multiple-pivottable-pivotchart-exporting/pivottable-pivotchart-exporting.component';
25+
import { ExternalTableExportingComponent } from './pivottable-with-external-table-exporting/pivottable-with-grid-exporting.component';
2126

2227
/**
2328
* Module
@@ -27,13 +32,14 @@ import { ChangePivotTableStyleComponent } from './change-pivot-table-style/chang
2732
BrowserModule,
2833
PivotViewAllModule,
2934
PivotFieldListAllModule,
35+
GridAllModule,
3036
RouterModule,
3137
AppRoutingModule
3238
],
33-
declarations: [AppComponent, TableExportingComponent, TableAndChartExportComponent, AddHeaderAndFooterComponent,
34-
ChangePageOrientationComponent, ChangeDocumentWidthAndHeightComponent, CustomizeColumnCountComponent,
35-
AddingCustomFontComponent, MultipleExportingComponent, ExportBlobDataComponent, ExportAllPagesComponent,
36-
ChangePageSizeComponent, ChangeFilenameComponent, ChangeTableColumnWidthAndRowHeightComponent, ChangePivotTableStyleComponent
39+
declarations: [AppComponent, TableExportingComponent, PivotChartExportingComponent, TableAndChartExportComponent, AddHeaderAndFooterComponent,
40+
ChangePageOrientationComponent, ChangeDocumentWidthAndHeightComponent, CustomizeColumnCountComponent, AddingCustomFontComponent,
41+
MultipleExportingComponent, MultiplePivotChartExportingComponent, MultipleTableChartExportingComponent, ExternalTableExportingComponent, ExportBlobDataComponent,
42+
ExportAllPagesComponent, ChangePageSizeComponent, ChangeFilenameComponent, ChangeTableColumnWidthAndRowHeightComponent, ChangePivotTableStyleComponent
3743
],
3844
bootstrap: [AppComponent]
3945
})

src/app/data.ts

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3081,4 +3081,81 @@ function getClassDate(data: Object[]): Object[] {
30813081
delete ((data[ln] as any)['Date']);
30823082
}
30833083
return data;
3084-
}
3084+
}
3085+
3086+
export let grid_Ddata: Object[] = [
3087+
{
3088+
OrderID: 10248, CustomerID: 'VINET', EmployeeID: 5, OrderDate: new Date(8364186e5),
3089+
ShipName: 'Vins et alcools Chevalier', ShipCity: 'Reims', ShipAddress: '59 rue de l Abbaye',
3090+
ShipRegion: 'CJ', ShipPostalCode: '51100', ShipCountry: 'France', Freight: 32.38, Verified: !0
3091+
},
3092+
{
3093+
OrderID: 10249, CustomerID: 'TOMSP', EmployeeID: 6, OrderDate: new Date(836505e6),
3094+
ShipName: 'Toms Spezialitäten', ShipCity: 'Münster', ShipAddress: 'Luisenstr. 48',
3095+
ShipRegion: 'CJ', ShipPostalCode: '44087', ShipCountry: 'Germany', Freight: 11.61, Verified: !1
3096+
},
3097+
{
3098+
OrderID: 10250, CustomerID: 'HANAR', EmployeeID: 4, OrderDate: new Date(8367642e5),
3099+
ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67',
3100+
ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'Brazil', Freight: 65.83, Verified: !0
3101+
},
3102+
{
3103+
OrderID: 10251, CustomerID: 'VICTE', EmployeeID: 3, OrderDate: new Date(8367642e5),
3104+
ShipName: 'Victuailles en stock', ShipCity: 'Lyon', ShipAddress: '2, rue du Commerce',
3105+
ShipRegion: 'CJ', ShipPostalCode: '69004', ShipCountry: 'France', Freight: 41.34, Verified: !0
3106+
},
3107+
{
3108+
OrderID: 10252, CustomerID: 'SUPRD', EmployeeID: 4, OrderDate: new Date(8368506e5),
3109+
ShipName: 'Suprêmes délices', ShipCity: 'Charleroi', ShipAddress: 'Boulevard Tirou, 255',
3110+
ShipRegion: 'CJ', ShipPostalCode: 'B-6000', ShipCountry: 'Belgium', Freight: 51.3, Verified: !0
3111+
},
3112+
{
3113+
OrderID: 10253, CustomerID: 'HANAR', EmployeeID: 3, OrderDate: new Date(836937e6),
3114+
ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67',
3115+
ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'Brazil', Freight: 58.17, Verified: !0
3116+
},
3117+
{
3118+
OrderID: 10254, CustomerID: 'CHOPS', EmployeeID: 5, OrderDate: new Date(8370234e5),
3119+
ShipName: 'Chop-suey Chinese', ShipCity: 'Bern', ShipAddress: 'Hauptstr. 31',
3120+
ShipRegion: 'CJ', ShipPostalCode: '3012', ShipCountry: 'Switzerland', Freight: 22.98, Verified: !1
3121+
},
3122+
{
3123+
OrderID: 10255, CustomerID: 'RICSU', EmployeeID: 9, OrderDate: new Date(8371098e5),
3124+
ShipName: 'Richter Supermarkt', ShipCity: 'Genève', ShipAddress: 'Starenweg 5',
3125+
ShipRegion: 'CJ', ShipPostalCode: '1204', ShipCountry: 'Switzerland', Freight: 148.33, Verified: !0
3126+
},
3127+
{
3128+
OrderID: 10256, CustomerID: 'WELLI', EmployeeID: 3, OrderDate: new Date(837369e6),
3129+
ShipName: 'Wellington Importadora', ShipCity: 'Resende', ShipAddress: 'Rua do Mercado, 12',
3130+
ShipRegion: 'SP', ShipPostalCode: '08737-363', ShipCountry: 'Brazil', Freight: 13.97, Verified: !1
3131+
},
3132+
{
3133+
OrderID: 10257, CustomerID: 'HILAA', EmployeeID: 4, OrderDate: new Date(8374554e5),
3134+
ShipName: 'HILARION-Abastos', ShipCity: 'San Cristóbal', ShipAddress: 'Carrera 22 con Ave. Carlos Soublette #8-35',
3135+
ShipRegion: 'Táchira', ShipPostalCode: '5022', ShipCountry: 'Venezuela', Freight: 81.91, Verified: !0
3136+
},
3137+
{
3138+
OrderID: 10258, CustomerID: 'ERNSH', EmployeeID: 1, OrderDate: new Date(8375418e5),
3139+
ShipName: 'Ernst Handel', ShipCity: 'Graz', ShipAddress: 'Kirchgasse 6',
3140+
ShipRegion: 'CJ', ShipPostalCode: '8010', ShipCountry: 'Austria', Freight: 140.51, Verified: !0
3141+
},
3142+
{
3143+
OrderID: 10259, CustomerID: 'CENTC', EmployeeID: 4, OrderDate: new Date(8376282e5),
3144+
ShipName: 'Centro comercial Moctezuma', ShipCity: 'México D.F.', ShipAddress: 'Sierras de Granada 9993',
3145+
ShipRegion: 'CJ', ShipPostalCode: '05022', ShipCountry: 'Mexico', Freight: 3.25, Verified: !1
3146+
},
3147+
{
3148+
OrderID: 10260, CustomerID: 'OTTIK', EmployeeID: 4, OrderDate: new Date(8377146e5),
3149+
ShipName: 'Ottilies Käseladen', ShipCity: 'Köln', ShipAddress: 'Mehrheimerstr. 369',
3150+
ShipRegion: 'CJ', ShipPostalCode: '50739', ShipCountry: 'Germany', Freight: 55.09, Verified: !0
3151+
},
3152+
{
3153+
OrderID: 10261, CustomerID: 'QUEDE', EmployeeID: 4, OrderDate: new Date(8377146e5),
3154+
ShipName: 'Que Delícia', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua da Panificadora, 12',
3155+
ShipRegion: 'RJ', ShipPostalCode: '02389-673', ShipCountry: 'Brazil', Freight: 3.05, Verified: !1
3156+
},
3157+
{
3158+
OrderID: 10262, CustomerID: 'RATTC', EmployeeID: 8, OrderDate: new Date(8379738e5),
3159+
ShipName: 'Rattlesnake Canyon Grocery', ShipCity: 'Albuquerque', ShipAddress: '2817 Milton Dr.',
3160+
ShipRegion: 'NM', ShipPostalCode: '87110', ShipCountry: 'USA', Freight: 48.29, Verified: !0
3161+
}];

src/app/exporting/exporting.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class TableExportingComponent implements OnInit {
3636
this.button.appendTo('#export');
3737

3838
this.button.element.onclick = (): void => {
39-
let pdfExportProperties: PdfExportProperties = { };
40-
this.pivotGridObj.pdfExport(pdfExportProperties, false, undefined, false);
39+
let pdfExportProperties: PdfExportProperties = { fileName: 'ProductSalesReport',};
40+
this.pivotGridObj.pdfExport(pdfExportProperties);
4141
};
4242
}
4343
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<h4>Multiple export</h4>
22
<div class="col-md-2"><button ej-button id='export'>Export</button></div>
33
<div class="col-md-8">
4+
<h2>Pivot Table 1</h2>
45
<ejs-pivotview #pivotview id='PivotView' height='350' [dataSourceSettings]=dataSourceSettings allowPdfExport='true'
56
(load)='load()' width=width></ejs-pivotview>
7+
<h2>Pivot Table 2</h2>
68
<ejs-pivotview #pivotview1 id='PivotView1' [dataSourceSettings]=dataSourceSettings1 allowPdfExport='true'
79
(load)='load1()'width=width></ejs-pivotview>
810
</div>

src/app/multiple-exporting/multiple-exporting.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ export class MultipleExportingComponent implements OnInit {
5959
this.button.appendTo('#export');
6060

6161
this.button.element.onclick = (): void => {
62-
this.firstGridPdfExport = this.pivotGridObj.pdfExport({}, true);
63-
this.firstGridPdfExport.then((pdfData: Object) => {
64-
this.pivotGridObj1.pdfExport({}, false, pdfData);
65-
});
62+
// Here we export the pivot table 1 as a PDF document and save it as an object in the variable firstGridPdfExport.
63+
this.firstGridPdfExport = this.pivotGridObj.pdfExport({}, true);
64+
this.firstGridPdfExport.then((pdfData: Object) => {
65+
// Here we export both pivot table 2 to the PDF document object "pdfData" that contains the pivot table 1 and the pivot table 2 and is exported as a downloadable file.
66+
this.pivotGridObj1.pdfExport({}, false, pdfData);
67+
});
6668
};
6769
}
6870
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/* csslint ignore:start */
2+
#export-btn {
3+
margin-bottom: 10px;
4+
}
5+
6+
#PivotViewFieldList {
7+
float: left;
8+
width: 58% !important;
9+
height: 100%;
10+
}
11+
12+
#PivotFieldList {
13+
float: right;
14+
width: 42%;
15+
height: 100%;
16+
}
17+
18+
#PivotFieldList .e-static {
19+
width: 100% !important;
20+
}
21+
/* csslint ignore:end */
22+
23+
24+
.e-pivotview .e-columnsheader .tempwrap {
25+
display: none;
26+
}
27+
.e-pivotview .e-rowsheader .tempwrap {
28+
display: none;
29+
}
30+
31+
/* csslint ignore:start */
32+
@font-face {
33+
font-family: 'e-pivot';
34+
src:
35+
url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMjhUSmAAAAEoAAAAVmNtYXCs3q0zAAABkAAAAEpnbHlmdaItOwAAAegAAAE0aGVhZBRYEz0AAADQAAAANmhoZWEHmQNtAAAArAAAACRobXR4D7gAAAAAAYAAAAAQbG9jYQDAAHIAAAHcAAAACm1heHABDwBBAAABCAAAACBuYW1lc0cOBgAAAxwAAAIlcG9zdK9TctUAAAVEAAAARwABAAADUv9qAFoEAAAA//4D6gABAAAAAAAAAAAAAAAAAAAABAABAAAAAQAAT8kba18PPPUACwPoAAAAANin5zgAAAAA2KfnOAAAAAAD6gPoAAAACAACAAAAAAAAAAEAAAAEADUAAQAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQPuAZAABQAAAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA4jToTQNS/2oAWgPoAJYAAAABAAAAAAAABAAAAAPoAAAD6AAAA+gAAAAAAAIAAAADAAAAFAADAAEAAAAUAAQANgAAAAgACAACAADiNOI56E3//wAA4jTiOehN//8AAAAAAAAAAQAIAAgACAAAAAEAAwACAAAAAAAAACYAcgCaAAAAAQAAAAADTAPoABUAAAkBBhY7AREUFjsBMjY1ETMyNicBJiIB3f7KCw4SxxAMqgwQxhIPC/7FCBgD3/6tDyH9wAwQEAwCQCEPAVMJAAEAAAAAA+oDTAA0AAABMx8BAR8DDwMBDwMjLwwhLwE1NzUnPwEhPwQ1PwQCXgIFCQFxBAIEAgEDBAf+ogYKBQUEAwQDAwICAQIBAQYJCf3mAgEDAgEBAh4KCAQCAQICAgIDA0wBBf7VAwQJCQkJCQf+4QQGAgEBAQIDBAQFC50DBAQDAQICCuANAgECBQIDAqcMBQQDAQAAAQAAAAADTAPoABYAAAEGFREjIgYXARYyNwE2JisBETQmKwEiAYsIxhIPDAE5CRgJATUMDhPGEAyqDAPgCAz9wCEP/q0JCQFTDyECQAwQAAAAABIA3gABAAAAAAAAAAEAAAABAAAAAAABAAcAAQABAAAAAAACAAcACAABAAAAAAADAAcADwABAAAAAAAEAAcAFgABAAAAAAAFAAsAHQABAAAAAAAGAAcAKAABAAAAAAAKACwALwABAAAAAAALABIAWwADAAEECQAAAAIAbQADAAEECQABAA4AbwADAAEECQACAA4AfQADAAEECQADAA4AiwADAAEECQAEAA4AmQADAAEECQAFABYApwADAAEECQAGAA4AvQADAAEECQAKAFgAywADAAEECQALACQBIyBlLWljb25zUmVndWxhcmUtaWNvbnNlLWljb25zVmVyc2lvbiAxLjBlLWljb25zRm9udCBnZW5lcmF0ZWQgdXNpbmcgU3luY2Z1c2lvbiBNZXRybyBTdHVkaW93d3cuc3luY2Z1c2lvbi5jb20AIABlAC0AaQBjAG8AbgBzAFIAZQBnAHUAbABhAHIAZQAtAGkAYwBvAG4AcwBlAC0AaQBjAG8AbgBzAFYAZQByAHMAaQBvAG4AIAAxAC4AMABlAC0AaQBjAG8AbgBzAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAHUAcwBpAG4AZwAgAFMAeQBuAGMAZgB1AHMAaQBvAG4AIABNAGUAdAByAG8AIABTAHQAdQBkAGkAbwB3AHcAdwAuAHMAeQBuAGMAZgB1AHMAaQBvAG4ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBAgEDAQQBBQADVXAxC2Fycm93LXJpZ2h0CURvd25fU29ydAAAAA==) format('truetype');
36+
font-weight: normal;
37+
font-style: normal;
38+
}
39+
40+
.e-pivotview .e-tool-expand::before {
41+
content: '\e702';
42+
}
43+
44+
.fileUpload {
45+
position: relative;
46+
overflow: hidden;
47+
margin: 10px;
48+
}
49+
50+
.fileUpload input.upload {
51+
position: absolute;
52+
top: 0;
53+
right: 0;
54+
margin: 0;
55+
padding: 0;
56+
font-size: 20px;
57+
cursor: pointer;
58+
opacity: 0;
59+
filter: alpha(opacity=0);
60+
}
61+
62+
/* csslint ignore:end */
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<h4>Multiple export</h4>
2+
<div class="col-md-2"><button ej-button id='export-btn'>Export</button></div>
3+
<div class="col-md-8">
4+
<ejs-pivotview #pivotview id='PivotView' height='350' [dataSourceSettings]=dataSourceSettings allowPdfExport='true'
5+
(load)='load()' width=width [displayOption]='displayOption' [chartSettings]='chartSettings'></ejs-pivotview>
6+
<ejs-pivotview #pivotview1 id='PivotView1' [dataSourceSettings]=dataSourceSettings1 allowPdfExport='true'
7+
(load)='load1()'width=width [displayOption]='displayOption' [chartSettings]='chartSettings1'></ejs-pivotview>
8+
</div>

0 commit comments

Comments
 (0)