مقال تقني

HotXLS Component: workbook audit and conversion workbench في Delphi

أنشئ وحرر وافحص واحسب وصدّر مصنفات Excel مباشرة من كود Delphi أو C++Builder. HotXLS مكتبة جداول Object Pascal أصلية مع المصدر لسير عمل XLS وXLSX، ومناسبة لأدوات سطح المكتب والمهام الدفعية وأنظمة التقارير وتوليد المستندات على الخادم دون أتمتة Microsoft Excel.

هذه المقالة موجّهة إلى teams receiving workbooks that must be inspected, classified, converted, or routed before processing. وهي تتعامل مع workbook audit and conversion workbench كجزء من هندسة المستندات في بيئة الإنتاج، لا كاستدعاء سريع لمكوّن.

الخطر العملي هو أن conversion pipelines fail when macros, external links, hidden sheets, formulas, metadata, and unsupported features are not visible before save. لذلك يحتاج المسار إلى عقد واضح وتشخيص قابل للملاحظة وملفات اختبار واقعية.

قرارات البنية

Audit before converting. conversion targets such as XLSX, XLS, ODS, CSV, HTML, or PDF-like reports / macro, external-link, hidden-sheet, protection, and formula policies

  • conversion targets such as XLSX, XLS, ODS, CSV, HTML, or PDF-like reports
  • macro, external-link, hidden-sheet, protection, and formula policies
  • feature preservation versus flattening versus blocking
  • operator review states, warnings, and retained audit reports

مسار التنفيذ

Use a feature inventory to choose conversion policy. The order below keeps the workflow reviewable for Delphi and C++Builder teams.

  1. open the workbook in audit mode and inventory sheets, metadata, formulas, links, and macros
  2. classify features into safe, warn, convert, preserve, or block
  3. show the operator a concise risk summary before conversion
  4. run the conversion with a named profile and capture feature-loss warnings
  5. compare key cells and workbook structure after conversion

أدلة التحقق

Audit evidence for conversion decisions. Keep these fields with the output or support record.

  • source format, sheet list, hidden-sheet count, macro presence, and external-link count
  • formula, chart, image, protection, validation, and defined-name summary
  • conversion profile, warning list, dropped-feature list, and output hash
  • operator decision and support report path

Conversion is a risk decision, not only a file save

A workbench should show what the workbook contains before converting it. Operators need to know whether macros, links, hidden content, formulas, charts, or protection change the acceptable path.

ملاحظات تنفيذ للإنتاج

اجعل موضوع «HotXLS Component: workbook audit and conversion workbench في Delphi» عقد خدمة واضحا حول استدعاءات HotXLS، مع فصل التحقق من الإدخال وكتابة المصنف وفحص الخرج وأدلة الدعم

  • حدد مصدر البيانات ونطاقات الخلايا وتنسيق الخرج قبل إنشاء المصنف
  • سجل عدد الصفوف والأوراق والتحذيرات ومسار الخرج في سجل دعم قابل للمراجعة
  • ضع التفاصيل الخاصة بالتطبيق داخل دوال مساعدة قابلة للاختبار بدلا من نشرها داخل حدث واجهة
  • افتح أو افحص الملف المحفوظ قبل تسليمه إلى نظام آخر أو إلى العميل

حالات فشل يجب اختبارها

  • نجاح SaveAs لا يثبت أن العقد التجاري بقي صحيحا
  • قد تختلف الخطوط والأذونات والإعدادات الإقليمية بين الخادم وجهاز التطوير
  • يجب ألا تكشف السجلات كلمات مرور أو بيانات عملاء أو روابط داخلية

مثال Delphi تفصيلي

يوضح المثال التالي حدود خدمة عملية لهذا الموضوع، مع إبقاء السياسات والسجلات والتحقق في طبقة يمكن اختبارها

procedure ConvertWorkbookWithAudit(const InputFile, OutputFile: string; const Profile: TConversionProfile);
var
  Wb: TXLSXWorkbook;
  BeforeState: TWorkbookInventory;
  AfterState: TWorkbookInventory;
begin
  RequireFileExists(InputFile);
  Wb := TXLSXWorkbook.Create;
  try
    Wb.Open(InputFile);
    BeforeState := CaptureWorkbookInventory(Wb);
    ApplyConversionProfile(Wb, Profile);
    WriteConversionAuditSheet(Wb, BeforeState, Profile);

    if Wb.SaveAs(OutputFile) <> 1 then
      RaiseWorkbookSaveError(OutputFile);

    AfterState := InspectSavedWorkbook(OutputFile);
    AssertConversionResult(BeforeState, AfterState, Profile.RequiredSignals);
    ArchiveConversionEvidence(InputFile, OutputFile, BeforeState, AfterState);
  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

Product documentation

HotXLS Component