Fix export button placement, finalize PDF layout

This commit is contained in:
Kai S. K. Engelbart 2021-01-25 10:09:00 +01:00
parent 852d5ae06e
commit 41060a0436
3 changed files with 50 additions and 33 deletions

View File

@ -60,18 +60,18 @@
<rb-form-radio name="multiple-samples" label="Multiple samples" [(ngModel)]="multipleSamples" [value]="true"> <rb-form-radio name="multiple-samples" label="Multiple samples" [(ngModel)]="multipleSamples" [value]="true">
</rb-form-radio> </rb-form-radio>
</div> </div>
<!-- CSV export -->
<rb-icon-button icon="forward-right" mode="primary" (click)="exportCSV()" *ngIf="spectrumNames.length">
Export to CSV
</rb-icon-button>
<!-- PDF exprot -->
<rb-icon-button icon="forward-right" mode="primary" (click)="exportPDF()" *ngIf="spectrumNames.length">
Export to PDF
</rb-icon-button>
</div> </div>
<!-- CSV export -->
<rb-icon-button icon="forward-right" mode="secondary" (click)="exportCSV()" *ngIf="spectrumNames.length" style="margin-right: 0.5rem">
Export to CSV
</rb-icon-button>
<!-- PDF exprot -->
<rb-icon-button icon="forward-right" mode="secondary" (click)="exportPDF()" *ngIf="spectrumNames.length">
Export to PDF
</rb-icon-button>
<div class="dpt-chart space-below"> <div class="dpt-chart space-below">
<canvas baseChart <canvas baseChart
class="dpt-chart" class="dpt-chart"

View File

@ -2,6 +2,7 @@
max-width: 800px; max-width: 800px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
margin-top: 0.5rem;
} }
.file-input { .file-input {

View File

@ -155,6 +155,7 @@ export class PredictionComponent implements OnInit {
}, },
{ {
table: { table: {
widths: ['auto', '*', 'auto', 'auto', 'auto'],
body: [ body: [
[ [
{text: new Date().toLocaleDateString(), style: 'tableHeader'}, {text: new Date().toLocaleDateString(), style: 'tableHeader'},
@ -206,52 +207,67 @@ export class PredictionComponent implements OnInit {
width: 500 width: 500
}, },
{ {
text: '*Disclaimer: This tool is still under development and Testing', table: {
style: 'subsubheader' body: [[{
}, stack: [
{ {
text: [ text: '*Disclaimer: This tool is still under development and Testing',
'The prediction and classification of material parameters are validated only for certain conditions.', style: 'subsubheader'
'These results may therefore under no circumstances be used to evaluate quality-relevant issues.', },
'For more details please contact ', {
{ text: [
text: 'CR/APS1-Lingenfelder', 'The prediction and classification of material parameters are validated only for certain conditions.',
link: 'mailto:dominic.lingenfelser@bosch.com' 'These results may therefore under no circumstances be used to evaluate quality-relevant issues.',
}, 'For more details please contact ',
'.' {
] text: 'CR/APS1-Lingenfelser',
link: 'mailto:dominic.lingenfelser@bosch.com'
},
'.'
]
},
]
}]],
},
margin: [25, 20]
}, },
{ {
table: { table: {
widths: ['*', '*', 'auto'],
body: [ body: [
[{text: 'Pr\u00fcfung', style: 'tableHeader'}, {text: 'Freigabe', style: 'tableHeader'}, {text: 'Datum', style: 'tableHeader'}], [{text: 'Pr\u00fcfung', style: 'tableHeader'}, {text: 'Freigabe', style: 'tableHeader'}, {text: 'Datum', style: 'tableHeader'}],
['CR/APS1-Lotter', 'CR/APS1-Lingenfelser', new Date().toLocaleDateString()] ['CR/APS1-Lotter', 'CR/APS1-Lingenfelser', new Date().toLocaleDateString()]
] ],
} }
},
{
text: '\u00a9 Alle Rechte bei Robert Bosch GmbH, auch f\u00fcr den Fall von Schutzreichtsanmeldungen. Jede Verf\u00fcgungsbefugnis, wie Kopier- und Weitergaberecht, bei uns.',
fontSize: 8
} }
], ],
footer: {
text: '\u00a9 Alle Rechte bei Robert Bosch GmbH, auch f\u00fcr den Fall von Schutzreichtsanmeldungen. Jede Verf\u00fcgungsbefugnis, wie Kopier- und Weitergaberecht, bei uns.',
fontSize: 8,
alignment: 'center'
},
styles: { styles: {
header: { header: {
fontSize: 18, fontSize: 18,
bold: true bold: true,
margin: [0, 10]
}, },
subheader: { subheader: {
fontSize: 15, fontSize: 15,
bold: true bold: true,
margin: [0, 8]
}, },
subsubheader: { subsubheader: {
bold: true bold: true,
margin: [0, 5]
}, },
tableHeader: { tableHeader: {
bold: true, bold: true,
fontSize: 13, fontSize: 13,
color: 'black' color: 'black'
} }
} },
pageMargins: [50, 50, 50, 15]
}; };
pdfMake.createPdf(dd).download(); pdfMake.createPdf(dd).download();