Ottieni la convalida della cella nei file ODS

Ottieni la Convalida Cellulare nei File ODS

Con Aspose.Cells, è possibile ottenere la convalida applicata a una cella nei file ODS. A tal fine, l’API fornisce il metodo GetValidation della classe Cell.

Il seguente esempio di codice dimostra l’uso del metodo GetValidation caricando il file ODS di origine e leggendo la convalida della cella A9.

Codice di Esempio

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
//directories
String sourceDir = Utils.Get_SourceDirectory();
// Instantiating a Workbook object
Workbook workbook = new Workbook(sourceDir + "SampleBook1.ods");
// Add a page break at cell Y30
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet worksheet = worksheets.get(0);
Cell cell = worksheet.getCells().get("A9");
if(cell.getValidation() != null)
{
System.out.println(cell.getValidation().getType());
}