Dieser deutsche Artikel behandelt HotXLS: comments, hyperlinks, and review workflows in Delphi für Teams, die mit Delphi, C++Builder, Lazarus/FPC und losLab-Komponenten arbeiten
Der Fokus liegt auf praxisnahen Entscheidungen, Fallstricken und Prüfpunkten, damit die Lösung im produktiven Einsatz verlässlich bleibt
Architekturentscheidungen
Treat review data as structured workbook content. comment author, visibility, formatting, and whether generated notes are editable / internal sheet links, external URLs, file links, mail links, and disabled-link policy
- comment author, visibility, formatting, and whether generated notes are editable
- internal sheet links, external URLs, file links, mail links, and disabled-link policy
- review status vocabulary and where status is stored
- link validation, warning display, and blocked-domain handling
Implementierungsablauf
Validate links and comments before delivery. The order below keeps the workflow reviewable for Delphi and C++Builder teams.
- write comments from a structured review model rather than free-form strings
- validate hyperlink targets before saving the workbook
- connect internal links to stable sheets and named ranges where possible
- generate a review summary sheet when comments drive workflow decisions
- record link warnings and comment counts for support
Validierungsnachweise
Review evidence for operators and auditors. Keep these fields with the output or support record.
- comment count, author list, target cells, visibility state, and generated-note source
- hyperlink type, target, validation result, and blocked-domain reason
- review status values and summary-sheet totals
- warnings for links pointing to hidden, missing, or renamed sheets
Links and notes shape user decisions
Comments and hyperlinks guide users through the workbook. They should have clear authorship, stable cell references, validated targets, and a policy for internal sheet navigation versus external URLs.
Implementierungshinweise für die Produktion
Behandle HotXLS: comments, hyperlinks, and review workflows in Delphi als klaren Servicevertrag rund um die HotXLS-Aufrufe, mit getrennten Schritten für Eingabeprüfung, Arbeitsmappenaufbau, Ausgabekontrolle und Support-Evidenz
- Datenquelle, Zellbereiche und Ausgabeformat festlegen, bevor die Arbeitsmappe erzeugt wird
- Zeilenanzahl, Blattanzahl, Warnungen und Ausgabepfad in ein prüfbares Support-Protokoll schreiben
- Anwendungsspezifische Details in testbare Helper kapseln, statt sie in UI-Ereignissen zu verteilen
- Die gespeicherte Datei erneut öffnen oder prüfen, bevor sie an ein anderes System oder an Kunden geht
Fehlerfälle, die getestet werden sollten
- Ein erfolgreicher SaveAs-Aufruf beweist noch nicht, dass der fachliche Vertrag stimmt
- Schriftarten, Rechte und regionale Einstellungen können auf Servern anders sein als auf Entwicklerrechnern
- Logs dürfen keine Passwörter, Kundendaten oder internen Links offenlegen
Ausführliches Delphi-Beispiel
Das folgende Beispiel zeigt eine praktische Servicegrenze für dieses Thema und hält Policy, Logging und Validierung testbar getrennt
procedure BuildReviewWorkbook(const SourceFile, OutputFile: string);
var
Wb: TXLSXWorkbook;
Review: TReviewInventory;
begin
RequireFileExists(SourceFile);
Wb := TXLSXWorkbook.Create;
try
Wb.Open(SourceFile);
Review := ScanCommentsAndHyperlinks(Wb);
FlagUnsafeExternalTargets(Review);
AddReviewQueueSheet(Wb, Review);
AddReviewerInstructions(Wb, [
'Confirm unresolved comments',
'Verify external hyperlinks',
'Approve mailto and file links before delivery'
]);
AssertNoBlockedHyperlinks(Review);
WriteReviewAudit(Wb, Review);
if Wb.SaveAs(OutputFile) <> 1 then
RaiseWorkbookSaveError(OutputFile);
finally
Wb.Free;
end;
end;
Produktionscheckliste
- Run the workflow on an empty workbook, a normal customer workbook, and a worst-case workbook
- Open the output with the target spreadsheet application or downstream importer
- Log product version, template version, profile, row count, output path, elapsed time, and warning count
- Keep passwords, temporary files, customer data, and support bundles under explicit retention rules
- Add regression workbooks when a customer file exposes a new edge case
Product documentation
Zusätzliche Codebeispiele
Sheet.Cells[2, 1].Value := 'Source record';
Sheet.AddHyperlink(2, 1, 'https://intranet.example.com/records/2214',
'Open record 2214', 'ERP source entry');
Sheet.Cells[3, 1].Value := 'Totals';
Sheet.AddHyperlinkToCell(3, 1, 'Overview!B12', 'Jump to totals');var
Book: IXLSWorkbook;
Sheet: IXLSWorksheet;
Remark: TXLSComment;
begin
Book := TXLSWorkbook.Create;
Sheet := Book.Sheets.Add;
Sheet.Name := 'Review';
Sheet.Cells.Item[5, 2].Value := 4821.50;
Remark := Sheet.Cells.Item[5, 2].AddComment('Awaiting sign-off from controller');
Remark.Visible := True; // pop the note open on first view
Sheet.AddHyperlink(7, 2, 'https://intranet.example.com/signoff/4821',
'Sign-off form', 'Opens the controller queue');
Book.SaveAs('review.xls');
end;