PUNKT-39 Headery w plikach CSV
This commit is contained in:
parent
b93d25fb5b
commit
4900fc9c6e
@ -62,10 +62,17 @@ export class RankingComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloadCSVResults() {
|
downloadCSVResults() {
|
||||||
|
const options = {
|
||||||
|
fieldSeparator: ';',
|
||||||
|
quoteStrings: '',
|
||||||
|
decimalseparator: ',',
|
||||||
|
showLabels: true,
|
||||||
|
headers: ['Punkty', 'Imię', 'Nazwisko']
|
||||||
|
};
|
||||||
const arr = this.data;
|
const arr = this.data;
|
||||||
arr.map(x => delete x['username']);
|
arr.map(x => delete x['username']);
|
||||||
// tslint:disable-next-line:no-unused-expression
|
// tslint:disable-next-line:no-unused-expression
|
||||||
new ngxCsv(arr, this.group.name + '_ranking_' + this.typeOfRankingToDisplay);
|
new ngxCsv(arr, this.group.name + '_ranking_' + this.typeOfRankingToDisplay, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
@ -103,8 +103,15 @@ export class TestsInGroupResultsComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downloadCSVResults() {
|
downloadCSVResults() {
|
||||||
|
const options = {
|
||||||
|
fieldSeparator: ';',
|
||||||
|
quoteStrings: '',
|
||||||
|
decimalseparator: ',',
|
||||||
|
showLabels: true,
|
||||||
|
headers: ['Imię', 'Nazwisko', 'Wynik', 'Wynik (%)']
|
||||||
|
};
|
||||||
// tslint:disable-next-line:no-unused-expression
|
// tslint:disable-next-line:no-unused-expression
|
||||||
new ngxCsv(this.testdata, this.group.name + '_' + this.selectedTest.title + '_wyniki');
|
new ngxCsv(this.testdata, this.group.name + '_' + this.selectedTest.title + '_wyniki', options);
|
||||||
}
|
}
|
||||||
|
|
||||||
getResults(id: number) {
|
getResults(id: number) {
|
||||||
|
Loading…
Reference in New Issue
Block a user