Hello,
I have a problem with some graphics when I copy a worksheet from a workbook to a new workbook.
The line charts are not rendered with the right colours. This only seems to happen with line charts in my case but maybe other types of charts have this problem too.
I have attached the template I used to reproduce the anomaly (named “test_aspose_3.xlsx”) and the files generated from this template (named “test_aspose_3_company_data.xlsx”, “test_aspose_3_global_results. xlsx” and “test_aspose_3_comparison.xlsx”) in which the line charts do not have the right colours (you can see that in the last file named “test_aspose_3_comparison.xlsx” there is no colour problem on the bar chart).
test_aspose_3.zip (162.5 KB)
And the code I used to generate these files below:
String excelFileName = "test_aspose_3.xlsx";
Workbook wb = new Workbook(excelFileName);
for (int i = 0; i < wb.getWorksheets().getCount(); i++) {
Worksheet ws = wb.getWorksheets().get(i);
CopyOptions copyOptions = new CopyOptions();
copyOptions.setReferToDestinationSheet(true);
copyOptions.setCopyInvalidFormulasAsValues(true);
Workbook copyWb = new Workbook();
Worksheet copyWs = copyWb.getWorksheets().get(0);
copyWs.setName(ws.getName());
copyWs.copy(ws, copyOptions);
copyWb.save(excelFileName.substring(0, excelFileName.length() - 5) + "_" + ws.getName() + ".xlsx");
}
Thanks in advance for your help, regards,
Charlie