ODS Dosyalarında Hücre Doğrulamasını Al

ODS Dosyalarında Hücre Doğrulamasını Al

Aspose.Cells for Node.js via C++ ile, ODS dosyalarındaki bir hücreye uygulanan doğrulamayı alabilirsiniz. Bunun için API, Cell.getValidation() metodunu Cell sınıfında sağlar.

Aşağıdaki kod örneği, kaynak ODS dosyasını yükleyerek ve A9 hücresinin doğrulamasını okuyarak Cell.getValidation() metodunun kullanımını gösterir.

Örnek Kod

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());
}