Erstellen, bearbeiten, pruefen, berechnen und exportieren Sie Excel-Arbeitsmappen direkt aus Delphi- oder C++Builder-Code. HotXLS ist eine native Object-Pascal-Bibliothek fuer XLS und XLSX, entwickelt fuer Desktop-Tools, Batchauftraege, Berichte und Dokumenterzeugung ohne Microsoft-Excel-Automatisierung.
Dieser Artikel richtet sich an teams receiving workbooks that must be inspected, classified, converted, or routed before processing. Er behandelt workbook audit and conversion workbench als produktive Dokumenttechnik und nicht als kurzen Komponentenaufruf.
Das praktische Risiko besteht darin, dass conversion pipelines fail when macros, external links, hidden sheets, formulas, metadata, and unsupported features are not visible before save. Deshalb braucht der Ablauf einen schriftlichen Vertrag, nachvollziehbare Diagnosen und reale Regressionsdateien.
Architekturentscheidungen
Audit before converting. conversion targets such as XLSX, XLS, ODS, CSV, HTML, or PDF-like reports / macro, external-link, hidden-sheet, protection, and formula policies
- conversion targets such as XLSX, XLS, ODS, CSV, HTML, or PDF-like reports
- macro, external-link, hidden-sheet, protection, and formula policies
- feature preservation versus flattening versus blocking
- operator review states, warnings, and retained audit reports
Implementierungsablauf
Use a feature inventory to choose conversion policy. The order below keeps the workflow reviewable for Delphi and C++Builder teams.
- open the workbook in audit mode and inventory sheets, metadata, formulas, links, and macros
- classify features into safe, warn, convert, preserve, or block
- show the operator a concise risk summary before conversion
- run the conversion with a named profile and capture feature-loss warnings
- compare key cells and workbook structure after conversion
Validierungsnachweise
Audit evidence for conversion decisions. Keep these fields with the output or support record.
- source format, sheet list, hidden-sheet count, macro presence, and external-link count
- formula, chart, image, protection, validation, and defined-name summary
- conversion profile, warning list, dropped-feature list, and output hash
- operator decision and support report path
Conversion is a risk decision, not only a file save
A workbench should show what the workbook contains before converting it. Operators need to know whether macros, links, hidden content, formulas, charts, or protection change the acceptable path.
Implementierungshinweise für die Produktion
Behandle HotXLS: workbook audit and conversion workbench 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 ConvertWorkbookWithAudit(const InputFile, OutputFile: string; const Profile: TConversionProfile);
var
Wb: TXLSXWorkbook;
BeforeState: TWorkbookInventory;
AfterState: TWorkbookInventory;
begin
RequireFileExists(InputFile);
Wb := TXLSXWorkbook.Create;
try
Wb.Open(InputFile);
BeforeState := CaptureWorkbookInventory(Wb);
ApplyConversionProfile(Wb, Profile);
WriteConversionAuditSheet(Wb, BeforeState, Profile);
if Wb.SaveAs(OutputFile) <> 1 then
RaiseWorkbookSaveError(OutputFile);
AfterState := InspectSavedWorkbook(OutputFile);
AssertConversionResult(BeforeState, AfterState, Profile.RequiredSignals);
ArchiveConversionEvidence(InputFile, OutputFile, BeforeState, AfterState);
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