Hello Aspose Team,
I have a template that populates the chart if it has data. Here there is two charts in each page.The max total charts to be displayed in the template is 40. But the chart can be less than that i.e the number of data = number of charts. So, for deleting the charts which does not contains the data we are using deleteRow() function as below:
for (int i = 0; i < lastrow; i++) {
if (ws.getCells().get(i, Integer.parseInt(0)?.getValue() == “”) {
xx++
if (xx > 1) {
ws.getCells().deleteRows(i - 1, lastrow)
break
}
} else {
xx = 0
}
}
This function is just removing the content of the cell but not the charts. So, for removing the charts from the excel we worksheet.getCharts().remove function as below and then using the deleteRow() functions to delete the empty row.
for(int start = 39; start >= startRow; start–){
ws.getCharts().remove(ws.getCharts().InnerList[start])
}
Using this function is only deleting the chart in single page but not all. Is there anything else that needs to be done beside these?
We are using aspose plugin version 19.5 for Java.
Thanks,
HarishhealthRiskAssessmentReport.xlsx.zip (1.0 MB)