We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

The chart in sheet not refersh when convent excel to image

hi @ahsaniqbalsidiqui the env use jdk12 , aspose-cell version 18.12 , window10 , Idea 2019.3 , all fonts installed

@zhangyongyong,

As per the other thread:

We reproduced the issue you mentioned using your template file and sample code. We found that when the worksheet is rendered as an image, the chart in the worksheet is not refreshed and the chart image is different from the source chart in the template file. We did test your problem in Windows 8 environment. Your issue was logged with an id “CELLSJAVA-43139” into our database.

We will look into it soon.

thank u support @Amjad_Sahi @ahsaniqbalsidiqui

@zhangyongyong,

You are welcome.

Hi @Amjad_Sahi whether we can use other language with aspose-cell to fix this kind problem

@zhangyongyong,

We cannot say anything unless we have evaluated your issue in details. Can you give us some time to analyze your problem accurately? We will try to figure it out soon.

We will notify you immediately after an update is available.

@zhangyongyong

We evaluated your issue further. Well, you need to refresh Pivottables and calculate formulas before rendering worksheet(s) to image. See the following sample code for your reference:
e.g
Sample code:

......
for(int i = 0; i < workbook.getWorksheets().getCount(); i++) {
Worksheet s = workbook.getWorksheets().get(i);
s.refreshPivotTables();
}
workbook.calculateFormula();
.......

But there is still an issue that refreshing pivottables now. We will check it and try to figure it out as soon as possible.

hi @Amjad_Sahi the way u tried same as us before , as u know it not work well . hope ur team fix bug as soon as possible

@zhangyongyong,

Sure, we will figure your issue out soon (hopefully in the next week or so).

@zhangyongyong,

We are pleased to inform you that your issue is fixed. Hopefully, you will get the fix in the next few days (2-3 days or so) after we have performed QA and incorporated other enhancement and fixes.

@zhangyongyong,

Please try our latest version/fix: Aspose.Cells for Java v20.2.6 (attached)

Please refresh the PivotTables, calculate charts and formulas in the workbook before rendering to image(s)/PDF.

See the following sample codes:
e.g
Sample code:

workbook.getWorksheets().refreshPivotTables();

int sheetCount = workbook.getWorksheets().getCount();

for (int i = 0; i < sheetCount; i++)

{

Worksheet sheet = workbook.getWorksheets().get(i);

ChartCollection charts = sheet.getCharts();

int chartCount = charts.getCount();

for (int j = 0; j < chartCount; j++)

{

charts.get(j).refreshPivotData();

}

}

workbook.calculateFormula(); 

Let us know your feedback.

aspose-cells-20.2.6-java.zip (7.0 MB)

hi @Amjad_Sahi thanks ur update firstly ,attach the code and screenshot for ur refer ,and kindly share ur fixed result (code and picture)微信截图_20200317161327.jpg (496.0 KB)
aspose.zip (1.5 KB)

@zhangyongyong,

Thanks for your feedback with screenshot and code segment.

Your are right, the issue is not fixed precisely as I tested. I am using similar code as yours but getting the same results. I have reopened your issue and we will look into it soon.

We are sorry for any inconvenience caused!

@zhangyongyong,
We think there is some issue in the code.
Please see the attachment named “aspose_modified.java”, can you try it?
aspose_modified.zip (1.6 KB)

About chart label position error, we have created an issue as CELLSJAVA-43148 for investigation.

The issues you have found earlier (filed as CELLSJAVA-43139,CELLSJAVA-43148) have been fixed in Aspose.Cells for Java v20.3. This message was posted using Bugs notification tool by ahsaniqbalsidiqui