الحصول على التحقق من الخلية في ملفات ODS
Contents
[
Hide
]
الحصول على التحقق من الخلية في ملفات ODS
مع Aspose.Cells، يمكنك الحصول على التحقق المطبق على خلية في ملفات ODS. لهذا الغرض، يوفر الواجهة البرمجية التطبيقية الطريقة GetValidation للفئة Cell.
الشيفرة البرمجية التالية توضح استخدام الطريقة GetValidation عن طريق تحميل ملف ODS المصدر (SampleBook1.ods) وقراءة التحقق من الخلية A9.
الكود المثالي
This file contains 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
// 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()); | |
} |