Artigo técnico

HotXLS: workbook audit and conversion workbench in Delphi

Crie, edite, inspecione, calcule e exporte pastas Excel diretamente de codigo Delphi ou C++Builder. HotXLS e uma biblioteca nativa Object Pascal para XLS e XLSX, projetada para ferramentas desktop, lotes, relatorios e geracao de documentos sem automacao do Microsoft Excel.

Este artigo é para teams receiving workbooks that must be inspected, classified, converted, or routed before processing. Ele trata workbook audit and conversion workbench como engenharia documental de produção, não como uma chamada isolada de componente.

O risco prático é que conversion pipelines fail when macros, external links, hidden sheets, formulas, metadata, and unsupported features are not visible before save. Por isso o fluxo precisa de contrato escrito, diagnósticos observáveis e arquivos de regressão representativos.

Decisões de arquitetura

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

Fluxo de implementação

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

Evidências de validação

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.

Notas de implementação para produção

Trate HotXLS: workbook audit and conversion workbench in Delphi como um contrato de serviço explícito em torno das chamadas HotXLS, separando validação de entrada, gravação da pasta de trabalho, verificação da saída e evidências para suporte

  • Defina fonte de dados, intervalos de células e formato de saída antes de criar a pasta de trabalho
  • Registre linhas, planilhas, avisos e caminho de saída em evidências revisáveis
  • Encapsule detalhes da aplicação em helpers testáveis, não em eventos de interface
  • Reabra ou inspecione o arquivo salvo antes de entregá-lo a outro sistema ou ao cliente

Falhas que devem ser ensaiadas

  • SaveAs com sucesso não prova que o contrato de negócio continua correto
  • Fontes, permissões e configurações regionais podem variar entre servidor e máquina de desenvolvimento
  • Logs não devem expor senhas, dados de clientes nem links internos

Exemplo Delphi detalhado

O exemplo Delphi a seguir mostra uma fronteira de serviço prática para este tema, mantendo política, logs e validação em uma camada testável

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 de produção

  • 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