Maak, bewerk, inspecteer, bereken en exporteer Excel-workbooks rechtstreeks vanuit Delphi- of C++Builder-code. HotXLS is een native Object Pascal-spreadsheetbibliotheek met broncode voor XLS- en XLSX-workflows, ontworpen voor desktoptools, batchtaken, rapportagesystemen en server-side documentgeneratie zonder Microsoft Excel-automatisering.
Dit artikel is bedoeld voor teams accepting OpenDocument Spreadsheet files while still producing Excel-compatible workflows. Het behandelt ODS open, save, and round-trip als productiegerichte documentengineering, niet als een losse componentaanroep.
Het praktische risico is dat round-trip support can preserve values but still lose formulas, styles, charts, or page settings when feature gaps are not reported. Daarom heeft de workflow een geschreven contract, observeerbare diagnose en representatieve regressiebestanden nodig.
Architectuurbeslissingen
Classify ODS compatibility before editing. accepted ODS sources, supported feature set, and blocked feature categories / formula, style, chart, image, conditional formatting, and page setup handling
- accepted ODS sources, supported feature set, and blocked feature categories
- formula, style, chart, image, conditional formatting, and page setup handling
- save format after editing and whether the user expects ODS or XLSX output
- warning policy for unsupported or approximated features
Implementatiepad
Track what is preserved, converted, or dropped. The order below keeps the workflow reviewable for Delphi and C++Builder teams.
- inspect the ODS package and create a feature inventory before editing
- map sheets, cells, formulas, styles, images, and charts to supported workbook objects
- apply edits while preserving original intent where possible
- save output in the chosen format and compare key sheets with the source
- attach a compatibility report when features are converted or dropped
Validatiebewijs
Round-trip evidence for customer trust. Keep these fields with the output or support record.
- source format, sheet count, formula count, style count, chart count, and image count
- preserved, converted, approximated, and dropped feature counts
- output format, warning summary, and key-cell comparison
- viewer compatibility notes for LibreOffice and Excel when relevant
OpenDocument and Excel models overlap but differ
ODS support should identify which workbook features map cleanly, which require conversion, and which need warnings. A professional workflow gives users evidence instead of pretending every spreadsheet model is identical.
Implementatienotities voor productie
Behandel HotXLS Component: ODS open, save, and round-trip in Delphi als een expliciet servicecontract rond de HotXLS-aanroepen, met gescheiden invoercontrole, werkmapopbouw, uitvoercontrole en supportbewijs
- Leg gegevensbron, celbereiken en uitvoerformaat vast voordat de werkmap wordt gemaakt
- Log rijenaantal, bladen, waarschuwingen en uitvoerpad in controleerbaar supportbewijs
- Plaats applicatiespecifieke details in testbare helpers in plaats van UI-events
- Open of inspecteer het opgeslagen bestand voordat het naar een ander systeem of klant gaat
Foutscenario's om te oefenen
- Een geslaagde SaveAs bewijst niet dat het zakelijke contract klopt
- Lettertypen, rechten en regionale instellingen kunnen verschillen tussen server en ontwikkelmachine
- Logs mogen geen wachtwoorden, klantgegevens of interne links onthullen
Uitgebreid Delphi-voorbeeld
Het volgende Delphi-voorbeeld toont een praktische servicegrens voor dit onderwerp en houdt beleid, logging en validatie testbaar gescheiden
procedure RoundTripOdsWorkbook(const InputOds, OutputOds: string);
var
Wb: TXLSXWorkbook;
BeforeState: TWorkbookInventory;
AfterState: TWorkbookInventory;
begin
RequireFileExists(InputOds);
Wb := TXLSXWorkbook.Create;
try
Wb.Open(InputOds);
BeforeState := CaptureWorkbookInventory(Wb);
NormalizeFeaturesForOdsOutput(Wb);
WriteCompatibilitySheet(Wb, BeforeState, 'ods-round-trip');
if Wb.SaveAs(OutputOds) <> 1 then
RaiseWorkbookSaveError(OutputOds);
AfterState := InspectSavedWorkbook(OutputOds);
CompareRoundTripInventory(BeforeState, AfterState, [
'sheet-count',
'used-ranges',
'formula-cells',
'visible-styles'
]);
finally
Wb.Free;
end;
end;
Productiechecklist
- 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