Skapa, redigera, granska, beräkna och exportera Excel-arbetsböcker direkt från Delphi- eller C++Builder-kod. HotXLS är ett nativt Object Pascal-bibliotek med källkod för XLS- och XLSX-flöden, avsett för skrivbordsverktyg, batchjobb, rapportsystem och serversidig dokumentgenerering utan Microsoft Excel-automatisering.
Den här artikeln är skriven för teams replacing Excel COM automation in services, batch tools, installers, or desktop utilities. Den behandlar Office-free workbook automation som produktionsnära dokumentteknik, inte som ett isolerat komponentanrop.
Den praktiska risken är att Excel automation is often hidden infrastructure; replacing it requires explicit policies for calculation, templates, fonts, formats, and deployment. Därför behöver flödet ett skrivet kontrakt, observerbar diagnostik och realistiska regressionsfiler.
Arkitekturbeslut
Remove desktop Office from the runtime contract. supported input and output formats such as XLS, XLSX, ODS, CSV, and HTML / template ownership, calculation expectations, and formatting policy
- supported input and output formats such as XLS, XLSX, ODS, CSV, and HTML
- template ownership, calculation expectations, and formatting policy
- service account permissions, file locking, concurrency, and temporary storage
- verification steps used instead of opening Excel during generation
Implementeringsflöde
Build workbook output as application logic. The order below keeps the workflow reviewable for Delphi and C++Builder teams.
- inventory existing COM automation behavior before replacing it
- move workbook generation into a service layer with explicit profiles
- load templates, fill data, calculate, validate, and save without launching Excel
- run output checks with workbook-level diagnostics and representative files
- deploy with file-system and service permissions tested under the real account
Valideringsbevis
Automation evidence for deployment. Keep these fields with the output or support record.
- automation profile, template version, input format, output format, and calculation mode
- service identity, output path, temporary storage, concurrency level, and elapsed time
- warnings for unsupported Excel automation behaviors that were not replicated
- open or validation result in target downstream applications
No Excel process means fewer surprises, not fewer decisions
Office-free automation avoids desktop session, COM, and installed Office dependencies. The application still needs to own workbook formats, calculation strategy, file locking, templates, and output verification.
Implementeringsanteckningar för produktion
Behandla HotXLS Component: Office-free workbook automation in Delphi som ett tydligt servicekontrakt runt HotXLS-anropen, med separerad indatavalidering, arbetsboksskrivning, utdata kontroll och supportbevis
- Bestäm datakälla, cellområden och utdataformat innan arbetsboken skapas
- Logga rader, blad, varningar och utdata sökväg i granskningsbar supportevidens
- Kapsla applikationsdetaljer i testbara helpers i stället för UI-händelser
- Öppna eller inspektera den sparade filen innan den lämnas till ett annat system eller kunden
Felmoder att öva
- En lyckad SaveAs bevisar inte att affärskontraktet fortfarande är korrekt
- Typsnitt, behörigheter och regionala inställningar kan skilja mellan server och utvecklingsdator
- Loggar får inte exponera lösenord, kunddata eller interna länkar
Detaljerat Delphi-exempel
Följande Delphi-exempel visar en praktisk servicegräns för ämnet och håller policy, loggning och validering testbart separerade
procedure BuildNightlyWorkbookWithoutExcel(const OutputFile: string; const ReportDate: TDate);
var
Wb: TXLSXWorkbook;
Summary: IXLSWorksheet;
Detail: IXLSWorksheet;
begin
Wb := TXLSXWorkbook.Create;
try
Summary := Wb.Sheets[0];
Summary.Name := 'Summary';
Detail := AddWorksheet(Wb, 'Detail');
WriteReportHeader(Summary, 'Nightly Operations', ReportDate);
WriteSummaryMetrics(Summary, LoadSummaryMetrics(ReportDate));
WriteDetailRows(Detail, LoadDetailRows(ReportDate));
LinkSummaryToDetail(Summary, Detail);
Wb.Calculate;
ValidateServerEnvironment(['fonts', 'temp-path', 'write-access']);
WriteAutomationAudit(Wb, 'no-excel-automation', ReportDate);
if Wb.SaveAs(OutputFile) <> 1 then
RaiseWorkbookSaveError(OutputFile);
finally
Wb.Free;
end;
end;
Produktionschecklista
- 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