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 integrating workbook output with document management, search, audit, or customer-delivery systems. Tratta workbook metadata and document properties come ingegneria documentale di produzione, non come una semplice chiamata al componente.
Il rischio pratico è che metadata is often copied from templates accidentally, causing wrong authors, stale revision labels, missing retention fields, or poor search results. Per questo il flusso richiede un contratto scritto, diagnostica osservabile e file di regressione realistici.
Decisioni architetturali
Own metadata as delivery data. standard properties such as title, subject, author, company, category, and keywords / custom properties needed for customer, job, retention, version, or workflow state
- standard properties such as title, subject, author, company, category, and keywords
- custom properties needed for customer, job, retention, version, or workflow state
- whether metadata can expose personal data, internal IDs, or confidential notes
- revision, generated-by, and template-version strategy
Percorso di implementazione
Set properties from the business record. The order below keeps the workflow reviewable for Delphi and C++Builder teams.
- clear template metadata that should not reach generated output
- populate standard and custom properties from the business record
- validate required properties before saving or uploading the workbook
- include metadata in search or DMS hand-off checks
- audit final properties when support bundles are created
Evidenze di validazione
Metadata evidence for document management. Keep these fields with the output or support record.
- standard property values, custom property names, and required-property status
- template version, generator version, job identifier, and retention category
- privacy review for metadata fields that may expose sensitive values
- DMS or search-index acceptance result
Workbook metadata is visible outside Excel
Document properties are consumed by search indexes, records systems, portals, DMS workflows, and support staff. They should be generated deliberately rather than inherited accidentally from a designer's template file.
Note di implementazione per la produzione
Tratta HotXLS: workbook metadata and document properties 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 StampWorkbookMetadata(const InputFile, OutputFile: string; const Props: TWorkbookDocumentProperties);
var
Wb: TXLSXWorkbook;
Cover: IXLSWorksheet;
begin
RequireFileExists(InputFile);
Wb := TXLSXWorkbook.Create;
try
Wb.Open(InputFile);
ApplyDocumentProperties(Wb, Props);
Cover := EnsureWorksheet(Wb, 'Document Info');
Cover.Range['A1'].Value := 'Document owner';
Cover.Range['B1'].Value := Props.Owner;
Cover.Range['A2'].Value := 'Classification';
Cover.Range['B2'].Value := Props.Classification;
Cover.Range['A3'].Value := 'Retention profile';
Cover.Range['B3'].Value := Props.RetentionProfile;
Cover.Range['A1:B3'].ApplyBuiltinStyle(xbsGood);
AssertMetadataPolicy(Wb, Props);
WriteMetadataAudit(Wb, Props);
if Wb.SaveAs(OutputFile) <> 1 then
RaiseWorkbookSaveError(OutputFile);
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