Articolo tecnico

HotXLS: workbook audit and conversion workbench in Delphi

Crea, modifica, ispeziona, calcola ed esporta cartelle di lavoro Excel direttamente da Delphi o C++Builder. HotXLS e una libreria nativa Object Pascal per XLS e XLSX, progettata per strumenti desktop, batch, report e generazione documenti senza automazione Microsoft Excel.

Questo articolo è rivolto a teams receiving workbooks that must be inspected, classified, converted, or routed before processing. Tratta workbook audit and conversion workbench come ingegneria documentale di produzione, non come una semplice chiamata al componente.

Il rischio pratico è che conversion pipelines fail when macros, external links, hidden sheets, formulas, metadata, and unsupported features are not visible before save. Per questo il flusso richiede un contratto scritto, diagnostica osservabile e file di regressione realistici.

Decisioni architetturali

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

Percorso di implementazione

Use a feature inventory to choose conversion policy. The order below keeps the workflow reviewable for Delphi and C++Builder teams.

  1. open the workbook in audit mode and inventory sheets, metadata, formulas, links, and macros
  2. classify features into safe, warn, convert, preserve, or block
  3. show the operator a concise risk summary before conversion
  4. run the conversion with a named profile and capture feature-loss warnings
  5. compare key cells and workbook structure after conversion

Evidenze di validazione

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.

Note di implementazione per la produzione

Tratta HotXLS: workbook audit and conversion workbench in Delphi come un contratto di servizio esplicito attorno alle chiamate HotXLS, separando validazione dell'input, scrittura della cartella, controllo dell'output ed evidenze di supporto

  • Definire origine dati, intervalli di celle e formato di output prima di creare la cartella
  • Registrare righe, fogli, avvisi e percorso di output in una prova verificabile
  • Incapsulare i dettagli applicativi in helper testabili invece che in eventi UI
  • Riaprire o ispezionare il file salvato prima di consegnarlo a un altro sistema o al cliente

Casi di errore da provare

  • Un SaveAs riuscito non prova che il contratto di business sia corretto
  • Font, permessi e impostazioni locali possono variare tra server e macchina di sviluppo
  • I log non devono esporre password, dati cliente o link interni

Esempio Delphi dettagliato

L'esempio Delphi seguente mostra un confine di servizio pratico per questo tema, mantenendo policy, logging e validazione in un livello testabile

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;

Checklist di produzione

  • 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

HotXLS Component