أنشئ وحرر وافحص واحسب وصدّر مصنفات Excel مباشرة من كود Delphi أو C++Builder. HotXLS مكتبة جداول Object Pascal أصلية مع المصدر لسير عمل XLS وXLSX، ومناسبة لأدوات سطح المكتب والمهام الدفعية وأنظمة التقارير وتوليد المستندات على الخادم دون أتمتة Microsoft Excel.
هذه المقالة موجّهة إلى teams accepting OpenDocument Spreadsheet files while still producing Excel-compatible workflows. وهي تتعامل مع ODS open, save, and round-trip كجزء من هندسة المستندات في بيئة الإنتاج، لا كاستدعاء سريع لمكوّن.
الخطر العملي هو أن round-trip support can preserve values but still lose formulas, styles, charts, or page settings when feature gaps are not reported. لذلك يحتاج المسار إلى عقد واضح وتشخيص قابل للملاحظة وملفات اختبار واقعية.
قرارات البنية
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
مسار التنفيذ
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
أدلة التحقق
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.
ملاحظات تنفيذ للإنتاج
اجعل موضوع «HotXLS Component: ODS open, save, and round-trip في Delphi» عقد خدمة واضحا حول استدعاءات HotXLS، مع فصل التحقق من الإدخال وكتابة المصنف وفحص الخرج وأدلة الدعم
- حدد مصدر البيانات ونطاقات الخلايا وتنسيق الخرج قبل إنشاء المصنف
- سجل عدد الصفوف والأوراق والتحذيرات ومسار الخرج في سجل دعم قابل للمراجعة
- ضع التفاصيل الخاصة بالتطبيق داخل دوال مساعدة قابلة للاختبار بدلا من نشرها داخل حدث واجهة
- افتح أو افحص الملف المحفوظ قبل تسليمه إلى نظام آخر أو إلى العميل
حالات فشل يجب اختبارها
- نجاح SaveAs لا يثبت أن العقد التجاري بقي صحيحا
- قد تختلف الخطوط والأذونات والإعدادات الإقليمية بين الخادم وجهاز التطوير
- يجب ألا تكشف السجلات كلمات مرور أو بيانات عملاء أو روابط داخلية
مثال Delphi تفصيلي
يوضح المثال التالي حدود خدمة عملية لهذا الموضوع، مع إبقاء السياسات والسجلات والتحقق في طبقة يمكن اختبارها
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;
قائمة فحص الإنتاج
- 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