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 delivering password-protected XLSX files from Delphi services or desktop applications için hazırlanmıştır. XLSX AES-protected output 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: protected workbook output can satisfy a password prompt but still fail policy if key handling, password delivery, viewer compatibility, and unsupported encrypted-read paths are unclear. 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
Separate workbook protection from file encryption. password generation, delivery, rotation, escrow, and retry policy / difference between workbook structure protection, sheet protection, and file encryption
- password generation, delivery, rotation, escrow, and retry policy
- difference between workbook structure protection, sheet protection, and file encryption
- supported target applications and whether encrypted input reading is part of scope
- temporary file and support-bundle handling for protected workbooks
Uygulama akışı
Create protected output from a named security profile. The order below keeps the workflow reviewable for Delphi and C++Builder teams.
- generate the workbook content and validate it before applying file encryption
- select the AES protection profile and obtain the password through approved code paths
- save the protected XLSX to a controlled temporary destination
- test open behavior with target Excel versions or downstream consumers
- log security profile identifiers without logging secrets
Doğrulama kanıtı
Protection evidence for delivery and support. Keep these fields with the output or support record.
- security profile, output format, protection mode, target viewer test, and output hash
- password delivery channel identifier without password value
- temporary path, cleanup result, and retention rule
- viewer compatibility result and operator-facing failure reason
Password-protected XLSX still needs workflow policy
AES-protected output is a delivery decision. The application should know how passwords are generated, transmitted, rotated, and never logged; it should also verify that target viewers can open the result.
Üretim uygulama notları
HotXLS Component: XLSX AES-protected output 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 SaveProtectedXlsxReport(const OutputFile, Password: string; const Rows: TArray<TSecureRow>);
var
Wb: TXLSXWorkbook;
Sh: IXLSWorksheet;
RowIndex: Integer;
Row: TSecureRow;
Policy: TEncryptionPolicy;
begin
RequireStrongWorkbookPassword(Password);
Policy := BuildEncryptionPolicy('customer-delivery', 256);
Wb := TXLSXWorkbook.Create;
try
Sh := Wb.Sheets[0];
Sh.Name := 'Secure Export';
WriteHeaderRow(Sh, ['RecordId', 'Owner', 'Amount', 'Status']);
RowIndex := 2;
for Row in Rows do
begin
Sh.Range['A' + IntToStr(RowIndex)].Value := Row.RecordId;
Sh.Range['B' + IntToStr(RowIndex)].Value := Row.Owner;
Sh.Range['C' + IntToStr(RowIndex)].Value := Row.Amount;
Sh.Range['D' + IntToStr(RowIndex)].Value := Row.Status;
Inc(RowIndex);
end;
WriteEncryptionAuditSheet(Wb, Policy, RowIndex - 2);
SaveAsEncryptedWorkbook(Wb, OutputFile, Password, Policy);
VerifyEncryptedWorkbookCanOpen(OutputFile, Password);
RegisterSecureDelivery(OutputFile, Policy);
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