Hi.
I have a problem after upgrading aspose-cells from version 21.3 to 22.4.
In my case I must copy ranges one by one from Sheet1 to Sheet3. Next, do something with data. Then I must copy back from Sheet3 to Sheet1. Each range contains Conditional Formatting.
Until version 21.3 it works fast. But in version 22.4 each copy and save slows down. For example, in test (for 10 ranges) execution time is 150 ms for version 21.3. For version 22.4 it takes 5000 ms.
@Test
void copyRangeWithConditionalFormatting() throws Exception {
Workbook workbook = new Workbook("C://test.xlsx");
try {
// we have some rows for copy
List<String> cellAddresses = List.of("A14:AA14", "A18:AA18", "A22:AA22", "A26:AA26", "A32:AA32", "A36:AA36", "A41:AA41", "A44:AA44", "A47:AA47", "A50:AA50");
Cells cells = workbook.getWorksheets().get(0).getCells();
Cells cells2 = workbook.getWorksheets().get(2).getCells();
for (String cellAddress : cellAddresses) {
// copy to Sheet3
Range source = cells.createRange("Sheet1!" + cellAddress);
Range range = cells2.createRange("Sheet3!" + cellAddress);
PasteOptions options = new PasteOptions();
options.setPasteType(PasteType.ALL);
range.copy(source, options);
// and copy back to Sheet1
source = cells2.createRange("Sheet3!" + cellAddress);
range = cells.createRange("Sheet1!" + cellAddress);
range.copy(source, options);
}
workbook.save("C://test_result.xlsx");
} catch (Exception e) {
throw new AsposeBookException(e);
}
}
In additional, I check this behavior starts from version 21.4.
When I remove all Conditional Formatting it works fast.
test.zip (14.6 KB)