Excel çalışma kitaplarını doğrudan Delphi veya C++Builder kodundan oluşturun, düzenleyin, inceleyin, hesaplayın ve dışa aktarın. HotXLS; Microsoft Excel otomasyonu olmadan masaüstü araçları, batch işleri, raporlama sistemleri ve sunucu tarafı belge üretimi için tasarlanmış, XLS ve XLSX iş akışlarına yönelik kaynak kodlu yerel bir Object Pascal kütüphanesidir.
Bu yazı teams accepting OpenDocument Spreadsheet files while still producing Excel-compatible workflows için hazırlanmıştır. ODS open, save, and round-trip konusunu tek bir bileşen çağrısı olarak değil, üretim düzeyinde belge mühendisliği olarak ele alır.
Pratik risk şudur: round-trip support can preserve values but still lose formulas, styles, charts, or page settings when feature gaps are not reported. Bu nedenle akışın yazılı sözleşmeye, gözlemlenebilir tanılara ve gerçekçi regresyon dosyalarına ihtiyacı vardır.
Mimari kararlar
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
Uygulama akışı
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
Doğrulama kanıtı
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.
Üretim uygulama notları
HotXLS Component: ODS open, save, and round-trip in Delphi konusunu HotXLS çağrılarının çevresinde açık bir servis sözleşmesi olarak ele alın; giriş doğrulama, çalışma kitabı yazma, çıktı denetimi ve destek kanıtını ayırın
- Çalışma kitabını oluşturmadan önce veri kaynağını, hücre aralıklarını ve çıktı biçimini belirleyin
- Satır sayısı, sayfalar, uyarılar ve çıktı yolunu incelenebilir destek kaydına yazın
- Uygulamaya özel ayrıntıları UI olaylarına değil test edilebilir helper'lara yerleştirin
- Dosyayı başka sisteme veya müşteriye vermeden önce kaydedilmiş çıktıyı yeniden açın veya inceleyin
Prova edilmesi gereken hata kipleri
- Başarılı SaveAs çağrısı iş sözleşmesinin doğru kaldığını kanıtlamaz
- Sunucu ile geliştirici makinesinde yazı tipleri, izinler ve bölgesel ayarlar farklı olabilir
- Loglar parola, müşteri verisi veya iç bağlantı açığa çıkarmamalıdır
Ayrıntılı Delphi örneği
Aşağıdaki Delphi örneği bu konu için pratik bir servis sınırı gösterir ve politika, günlükleme ve doğrulamayı test edilebilir katmanda tutar
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;
Üretim kontrol listesi
- 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