If you wish to retrieve the image data for the icon used on particular cell as a result of conditional formatting rule then you may use the following piece of code.
Java
Workbook book = new Workbook(dir + “cond3.xlsx”); Worksheet worksheet = book.getWorksheets().get(0); for(int i = 3; i < 14; i++) { Cell cell = worksheet.getCells().get(i, CellsHelper.columnNameToIndex(“E”)); ConditionalFormattingResult result = cell.getConditionalFormattingResult(); ConditionalFormattingIcon icon = result.getConditionalFormattingIcon(); FileOutputStream fos = new FileOutputStream(dir + cell.getName() + “.png”); fos.write(icon.getImageData()); fos.close(); }
If you wish to retrieve which type of arrow is being used on particular cell as a result of conditional formatting rule then you have to develop a mapping mechanism on your own because Aspose.Cells APIs do not provide an enumeration for this purpose. Please check the following piece of code for elaboration.
Java
Workbook book = new Workbook(dir + “cond3.xlsx”); Worksheet worksheet = book.getWorksheets().get(0); for(int i = 3; i < 14; i++) { Cell cell = worksheet.getCells().get(i, CellsHelper.columnNameToIndex(“E”)); ConditionalFormattingResult result = cell.getConditionalFormattingResult(); ConditionalFormattingIcon icon = result.getConditionalFormattingIcon(); int style = icon.getIndex();