Kern flaechen.rs (Abfragen areaTable/ivhb): GF = NGF + KF, KF aus Wandgrundrissen und KGF-Räumen, AGF separat, GV; GFZ, AZ, BMZ, ÜZ, GZ, Gesamt-/Fassadenhöhe. Bericht als CSV (mit Rückleser), SVG und Vektor-PDF, Abschnitt im Flächenbilanz-Panel, CLI kennzahlen --sia416 --ivhb --format json|csv|svg|pdf. Claude-Session: https://claude.ai/code/session_01NTYBZBvLYCtugMJoKXaB67
18 lines
601 B
TypeScript
18 lines
601 B
TypeScript
// Stösst den Download einer Datei an (reiner Client, Blob-URL).
|
||
|
||
export function downloadFile(fileName: string, blob: Blob): void {
|
||
const url = URL.createObjectURL(blob);
|
||
const a = document.createElement("a");
|
||
a.href = url;
|
||
a.download = fileName;
|
||
document.body.appendChild(a);
|
||
a.click();
|
||
document.body.removeChild(a);
|
||
URL.revokeObjectURL(url);
|
||
}
|
||
|
||
/** CSV mit BOM, damit Excel UTF-8 (Umlaute/„m²") korrekt liest. */
|
||
export function downloadCsv(fileName: string, content: string): void {
|
||
downloadFile(fileName, new Blob(["" + content], { type: "text/csv;charset=utf-8;" }));
|
||
}
|