الحصول على التحقق من الخلية في ملفات ODS

الحصول على التحقق من الخلية في ملفات ODS

مع Aspose.Cells for Node.js via C++، يمكنك الحصول على التحقق المطبق على خلية في ملفات ODS. توفر واجهة برمجة التطبيقات Cell.getValidation() من الفئة Cell هذا الأمر.

يوضح نموذج الكود التالي استخدام طريقة Cell.getValidation() بتحميل ملف المصدر ODS وقراءة التحقق من صحة الخلية A9.

الكود المثالي

const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const sourceDir = path.join(__dirname, "data");
// Load source Excel file
const workbook = new AsposeCells.Workbook(path.join(sourceDir, "SampleBook1.ods"));
// Access first worksheet
const worksheet = workbook.getWorksheets().get(0);
const cell = worksheet.getCells().get("A9");
if (cell.getValidation() !== null)
{
console.log(cell.getValidation().getType());
}