Skip to content

Commit 5abf5db

Browse files
Update projects
1 parent cc73c7e commit 5abf5db

43 files changed

Lines changed: 2460 additions & 555 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Angular/package-lock.json

Lines changed: 617 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Angular/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"@angular/router": "^18.0.3",
2525
"devextreme": "25.1.3",
2626
"devextreme-angular": "25.1.3",
27+
"exceljs": "^4.4.0",
28+
"file-saver": "^2.0.5",
2729
"rxjs": "~7.8.0",
2830
"tslib": "^2.3.0",
2931
"zone.js": "~0.14.7"
@@ -32,7 +34,9 @@
3234
"@angular-devkit/build-angular": "^18.0.4",
3335
"@angular/cli": "~18.0.4",
3436
"@angular/compiler-cli": "^18.0.3",
37+
"@types/file-saver": "^2.0.7",
3538
"@types/jasmine": "~4.3.0",
39+
"@types/node": "^24.7.0",
3640
"eslint": "^8.39.0",
3741
"eslint-config-devextreme": "^1.1.4",
3842
"eslint-plugin-no-only-tests": "^3.1.0",
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Injectable } from '@angular/core';
2+
3+
const dataSource = {
4+
store: {
5+
type: 'xmla',
6+
url: 'https://demos.devexpress.com/Services/OLAP/msmdpump.dll',
7+
catalog: 'Adventure Works DW Standard Edition',
8+
cube: 'Adventure Works',
9+
},
10+
fields: [{
11+
dataField: '[Product].[Category]',
12+
area: 'row',
13+
sortBySummaryField: '[Measures].[Sales Amount]',
14+
sortOrder: 'desc',
15+
}, {
16+
dataField: '[Product].[Subcategory]',
17+
area: 'row',
18+
sortBySummaryField: '[Measures].[Sales Amount]',
19+
sortOrder: 'desc',
20+
}, {
21+
dataField: '[Ship Date].[Calendar Year]',
22+
area: 'column',
23+
filterValues: [['CY 2003'], ['CY 2004']],
24+
}, {
25+
dataField: '[Ship Date].[Month of Year]',
26+
area: 'column',
27+
}, {
28+
dataField: '[Measures].[Sales Amount]',
29+
area: 'data',
30+
format: 'currency',
31+
}, {
32+
dataField: '[Measures].[Tax Amount]',
33+
area: 'data',
34+
format: 'currency',
35+
}],
36+
};
37+
38+
@Injectable({
39+
providedIn: 'root',
40+
})
41+
export class AdventureWorksService {
42+
getPivotGridDataSource(): any {
43+
return dataSource;
44+
}
45+
}

Angular/src/app/app.component.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
<div class="default-style">
2-
<dx-button [text]="buttonText" (onClick)="onClick($event)"></dx-button>
3-
</div>
1+
<dx-pivot-grid
2+
id="pivot-grid"
3+
[dataSource]="dataSource"
4+
[allowSorting]="true"
5+
[allowSortingBySummary]="true"
6+
[allowFiltering]="true"
7+
(onExporting)="exportGrid($event)"
8+
>
9+
<dxo-field-panel [visible]="true" [showFilterFields]="false">
10+
</dxo-field-panel>
11+
<dxo-field-chooser [allowSearch]="true"> </dxo-field-chooser>
12+
<dxo-export [enabled]="true"> </dxo-export>
13+
</dx-pivot-grid>

Angular/src/app/app.component.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.default-style {
2-
margin: 50px;
3-
width: 90vw;
1+
#pivot-grid {
2+
height: 70vh;
43
}

Angular/src/app/app.component.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
import { Component } from '@angular/core';
2-
import { ClickEvent } from 'devextreme/ui/button';
2+
import { AdventureWorksService } from './adventureworks.service';
3+
import type { PivotGridDataSource } from './app.types';
34

45
@Component({
56
selector: 'app-root',
67
templateUrl: './app.component.html',
78
styleUrls: ['./app.component.scss'],
9+
providers: [AdventureWorksService],
810
})
911
export class AppComponent {
10-
title = 'Angular';
12+
title = 'Getting Started with DevExtreme Angular PivotGrid';
1113

12-
counter = 0;
14+
dataSource: PivotGridDataSource;
1315

14-
buttonText = 'Click count: 0';
16+
constructor(service: AdventureWorksService) {
17+
this.dataSource = service.getPivotGridDataSource();
18+
}
1519

16-
onClick(e: ClickEvent): void {
17-
this.counter++;
18-
this.buttonText = `Click count: ${this.counter}`;
20+
exportGrid(e: any): void {
21+
// Export functionality can be implemented here
22+
// For this example, we'll just prevent the default export
23+
e.cancel = true;
24+
// eslint-disable-next-line no-console
25+
console.log('Export functionality can be implemented using DevExtreme export capabilities');
1926
}
2027
}

Angular/src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3-
import { DxButtonModule } from 'devextreme-angular/ui/button';
3+
import { DxPivotGridModule } from 'devextreme-angular/ui/pivot-grid';
44
import { AppRoutingModule } from './app-routing.module';
55
import { AppComponent } from './app.component';
66

@@ -11,7 +11,7 @@ import { AppComponent } from './app.component';
1111
imports: [
1212
BrowserModule,
1313
AppRoutingModule,
14-
DxButtonModule,
14+
DxPivotGridModule,
1515
],
1616
providers: [],
1717
bootstrap: [AppComponent],

Angular/src/app/app.types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface PivotGridDataSource {
2+
store: any;
3+
fields: any[];
4+
}

Angular/src/app/orig_adventureworks.service.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

Angular/src/app/orig_app.component.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)