Add labels to csv exports; Fix NaN annoyance

parent bb87322b
...@@ -74,7 +74,7 @@ export class CsvCreator { ...@@ -74,7 +74,7 @@ export class CsvCreator {
// Set utf-8 header to let excel recognize its encoding // Set utf-8 header to let excel recognize its encoding
let blob = new Blob(["\ufeff", encodedStr], { type: "text/csv" }); let blob = new Blob(["\ufeff", encodedStr], { type: "text/csv" });
a.href = window.URL.createObjectURL(blob); a.href = window.URL.createObjectURL(blob);
a.download = (this.settings.fileName || "epalSystemReport") + "all_stat" + ".csv"; a.download = (this.settings.fileName || "epalSystemReport") + "_all_stat" + ".csv";
a.click(); a.click();
}); });
} }
......
...@@ -300,11 +300,13 @@ import { ReportsSchema, TableColumn } from "./reports-schema"; ...@@ -300,11 +300,13 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
route = "/ministry/report-all-stat/"; route = "/ministry/report-all-stat/";
this.distribFinalized = 1; this.distribFinalized = 1;
this.settings = this.reportSchema.reportAllStatSchema; this.settings = this.reportSchema.reportAllStatSchema;
this.settings.fileName = "e-ΕΠΑΛ Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ";
} }
else if (this.reportId === 5) { else if (this.reportId === 5) {
route = "/ministry/report-all-stat/"; route = "/ministry/report-all-stat/";
this.distribFinalized = 0; this.distribFinalized = 0;
this.settings = this.reportSchema.reportAllStatSchema; this.settings = this.reportSchema.reportAllStatSchema;
this.settings.fileName = "e-ΕΠΑΛ Ολιγομελή τμήματα - Προσωρινά τοποθετημένοι μαθητές";
} }
let regSel = 0, admSel = 0, schSel = 0; let regSel = 0, admSel = 0, schSel = 0;
...@@ -326,8 +328,9 @@ import { ReportsSchema, TableColumn } from "./reports-schema"; ...@@ -326,8 +328,9 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
if (this.userLoggedIn === PDE_ROLE) { if (this.userLoggedIn === PDE_ROLE) {
regSel = this.regionSelected; regSel = this.regionSelected;
} }
else if (this.userLoggedIn === DIDE_ROLE) else if (this.userLoggedIn === DIDE_ROLE) {
admSel = this.adminAreaSelected; admSel = this.adminAreaSelected;
}
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel, this.distribFinalized).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel, this.distribFinalized).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
...@@ -339,8 +342,17 @@ import { ReportsSchema, TableColumn } from "./reports-schema"; ...@@ -339,8 +342,17 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
this.data[i].percTotal = Number(data[i].percTotal); this.data[i].percTotal = Number(data[i].percTotal);
this.data[i].percA = Number(data[i].percA); this.data[i].percA = Number(data[i].percA);
if (Number.isNaN(this.data[i].percA)) {
this.data[i].percA = "-";
}
this.data[i].percB = Number(data[i].percB); this.data[i].percB = Number(data[i].percB);
if (Number.isNaN(this.data[i].percB)) {
this.data[i].percB = "-";
}
this.data[i].percC = Number(data[i].percC); this.data[i].percC = Number(data[i].percC);
if (Number.isNaN(this.data[i].percC)) {
this.data[i].percC = "-";
}
} }
this.validCreator = 1; this.validCreator = 1;
this.source = new LocalDataSource(this.data); this.source = new LocalDataSource(this.data);
...@@ -353,10 +365,10 @@ import { ReportsSchema, TableColumn } from "./reports-schema"; ...@@ -353,10 +365,10 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
// this.prepareColumnMap(); // this.prepareColumnMap();
this.csvObj.prepareColumnMap(); this.csvObj.prepareColumnMap();
}, },
error => { error => {
this.generalReport$.next([{}]); this.generalReport$.next([{}]);
console.log("Error Getting generalReport"); console.log("Error Getting generalReport");
}); });
} }
navigateBack() { navigateBack() {
......
...@@ -12,6 +12,7 @@ export class ReportsSchema { ...@@ -12,6 +12,7 @@ export class ReportsSchema {
ReportUsersSchema = { ReportUsersSchema = {
actions: false, actions: false,
fileName: "e-ΕΠΑΛ Αριθμός Αιτήσεων - Εγγεγραμμένων Χρηστών",
noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης", noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης",
columns: { columns: {
name: { name: {
...@@ -27,6 +28,7 @@ export class ReportsSchema { ...@@ -27,6 +28,7 @@ export class ReportsSchema {
genReportSchema = { genReportSchema = {
actions: false, actions: false,
fileName: "e-ΕΠΑΛ Κατανομή Μαθητών με Βάση τη Σειρά Προτίμησης",
noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης", noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης",
columns: { columns: {
name: { name: {
...@@ -42,6 +44,7 @@ export class ReportsSchema { ...@@ -42,6 +44,7 @@ export class ReportsSchema {
reportAllStatSchema = { reportAllStatSchema = {
actions: false, actions: false,
fileName: "e-ΕΠΑΛ Αναφορά",
pager: { pager: {
display: true, display: true,
perPage: 10 perPage: 10
...@@ -88,6 +91,7 @@ export class ReportsSchema { ...@@ -88,6 +91,7 @@ export class ReportsSchema {
reportNoCapacity = { reportNoCapacity = {
actions: false, actions: false,
fileName: "e-ΕΠΑΛ Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων",
pager: { pager: {
display: true, display: true,
perPage: 10 perPage: 10
...@@ -124,6 +128,7 @@ export class ReportsSchema { ...@@ -124,6 +128,7 @@ export class ReportsSchema {
reportCompletenessSchema = { reportCompletenessSchema = {
actions: false, actions: false,
fileName: "e-ΕΠΑΛ Συνολική Πληρότητα σχολικών μονάδων ΕΠΑΛ ανά τάξη",
noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης", noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης",
columns: { columns: {
name: { name: {
......
...@@ -236,7 +236,7 @@ div.changecolorbalck { ...@@ -236,7 +236,7 @@ div.changecolorbalck {
.d3-chart { .d3-chart {
width: 100%; width: 100%;
/* height: 400px; */ height: 550px;
} }
.d3-chart .axis path, .d3-chart .axis line { .d3-chart .axis path, .d3-chart .axis line {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment