Ottieni la convalida della cella nei file ODS
Contents
[
Hide
]
Ottieni la Convalida Cellulare nei File ODS
Con Aspose.Cells for Node.js via C++, puoi ottenere la validazione applicata a una cella nei file ODS. Per questo, l’API fornisce il metodo Cell.getValidation() della classe Cell.
Il seguente esempio di codice dimostra l’uso del metodo Cell.getValidation() caricando il file origine ODS e leggendo la validazione della cella A9.
Codice di Esempio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} |