Add export functionality to /sender Dashboard (Phase 6e)
Finalized the implementation of the export feature for the `EnvelopeSenderPage.razor` in the Blazor WASM Client. The feature supports exporting grid data in XLSX, CSV, and PDF formats, with an option to export only selected rows. - Updated `SF-74-PLAN.6e.md` to reflect the completed Phase 6e. - Integrated a compact UI for export controls in the toolbar: - Dropdown for format selection (XLSX, CSV, PDF). - Checkbox for "Only selected rows" option. - Single `Exportieren` button to trigger the export. - Implemented `ExportSelectedFormatAsync` to handle export logic: - Supported formats: XLSX, CSV, PDF. - Added options for `ExportSelectedRowsOnly` and grouping. - Replaced placeholder `ExportToExcelAsync` with finalized logic. - Documented known limitations (e.g., template columns not exported). - Updated project status table to mark Phase 6e as complete. This commit ensures a streamlined and user-friendly export UX, consistent with the existing design, while addressing known DevExpress limitations.
This commit is contained in:
@@ -39,7 +39,7 @@ EnvelopeGenerator.Server.Client/ → Blazor WASM Client
|
||||
|
||||
---
|
||||
|
||||
## ✅ Abgeschlossene Phasen (1–5, 6a–6c)
|
||||
## ✅ Abgeschlossene Phasen (1–5, 6a–6e)
|
||||
|
||||
| Phase | Inhalt | Status |
|
||||
|-------|--------|--------|
|
||||
@@ -52,6 +52,7 @@ EnvelopeGenerator.Server.Client/ → Blazor WASM Client
|
||||
| 6b | Kunden-Logo Placeholder (sender-customer-logo-area, CSS) | ✅ |
|
||||
| 6c | Grid-Spalten (EnvelopeTypeTitle, AddedWhen, ChangedWhen) + Persistence Hint | ✅ |
|
||||
| 6d | Dokument anzeigen (PDF Preview Popup mit DxPdfViewer) | ✅ |
|
||||
| 6e | Export (XLSX/CSV/PDF + Selected Rows Only) | ✅ |
|
||||
|
||||
**Key decisions:** TBDD_CACHE statt eigener DB-Tabelle · `SenderOrReceiver` Policy · Slider statt Toggle · `signflow.theme` in localStorage · DevExpress 25.2.3 hat keine `.dark.`-Suffix-Dateien
|
||||
|
||||
@@ -310,20 +311,40 @@ Button: nur aktiv wenn Envelope ausgewählt UND Dokument vorhanden (`envelope.Do
|
||||
|
||||
---
|
||||
|
||||
## 🔲 Phase 6e — Export nach Excel
|
||||
## ✅ Phase 6e — Export (XLSX/CSV/PDF)
|
||||
|
||||
### Technischer Ansatz
|
||||
|
||||
`DxGrid.ExportToXlsxAsync(fileName, options)` — direkt im Razor-Code, keine Backend-Implementierung nötig.
|
||||
`DxGrid`-Export direkt im Razor-Code, keine Backend-Implementierung nötig.
|
||||
Download geht direkt an den Browser.
|
||||
|
||||
```csharp
|
||||
async Task ExportToExcelAsync()
|
||||
async Task ExportSelectedFormatAsync()
|
||||
{
|
||||
var grid = _activeTab == "active" ? _gridActive : _gridCompleted;
|
||||
if (grid is null) return;
|
||||
var fileName = $"Umschlaege_{DateTime.Now:yyyy-MM-dd}.xlsx";
|
||||
await grid.ExportToXlsxAsync(fileName, new GridXlExportOptions());
|
||||
|
||||
var baseName = $"Umschlaege_{DateTime.Now:yyyy-MM-dd}";
|
||||
switch (_selectedExportFormat)
|
||||
{
|
||||
case "csv":
|
||||
await grid.ExportToCsvAsync(baseName, new GridCsvExportOptions {
|
||||
ExportSelectedRowsOnly = _exportSelectedRowsOnly
|
||||
});
|
||||
break;
|
||||
case "pdf":
|
||||
await grid.ExportToPdfAsync(baseName, new GridPdfExportOptions {
|
||||
ExportSelectedRowsOnly = _exportSelectedRowsOnly,
|
||||
SelectedRowsExportMode = GridSelectedRowsExportMode.KeepGrouping
|
||||
});
|
||||
break;
|
||||
default:
|
||||
await grid.ExportToXlsxAsync(baseName, new GridXlExportOptions {
|
||||
ExportSelectedRowsOnly = _exportSelectedRowsOnly,
|
||||
SelectedRowsExportMode = GridSelectedRowsExportMode.KeepGrouping
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -331,13 +352,15 @@ async Task ExportToExcelAsync()
|
||||
> Die Spalten `Status`, `EnvelopeReceivers` nutzen Templates → Wert im Export ist leer.
|
||||
> **Future Task:** Für vollständigen Export mit formatierten Zellen `CustomizeCell`-Event nutzen.
|
||||
|
||||
Button in Toolbar:
|
||||
UI in Toolbar (kompakt):
|
||||
```razor
|
||||
<button class="sender-btn" @onclick="ExportToExcelAsync"
|
||||
title="Aktuelle Ansicht als Excel exportieren">
|
||||
<!-- Excel-Icon SVG -->
|
||||
Export nach Excel
|
||||
</button>
|
||||
<select @bind="_selectedExportFormat">
|
||||
<option value="xlsx">XLSX</option>
|
||||
<option value="csv">CSV</option>
|
||||
<option value="pdf">PDF</option>
|
||||
</select>
|
||||
<input type="checkbox" @bind="_exportSelectedRowsOnly" /> Nur ausgewählte
|
||||
<button @onclick="ExportSelectedFormatAsync">Exportieren</button>
|
||||
```
|
||||
|
||||
---
|
||||
@@ -399,7 +422,7 @@ und sollte zuletzt implementiert werden, wenn alle Komponenten fertig sind.
|
||||
| # | Thema | Status |
|
||||
|---|-------|--------|
|
||||
| 1 | `DxPdfViewer` → InteractiveServer zwingend | Architektonisch gelöst (6d) |
|
||||
| 2 | Excel-Export: Template-Spalten leer im Export | Akzeptiert, Future Task (CustomizeCell) |
|
||||
| 2 | Export: Template-Spalten leer im Export | Akzeptiert, Future Task (CustomizeCell) |
|
||||
| 3 | `Zurückrufen/löschen` — Bedeutung unklar | Kommentar-Frage vorbereitet (6f) |
|
||||
| 4 | `EnvelopeTypeTitle` Mapping prüfen | Vor 6c verifizieren |
|
||||
| 5 | Logo-Pfade produktionsspezifisch | Via `appsettings.json` konfigurierbar |
|
||||
|
||||
Reference in New Issue
Block a user