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

Free Support Forum - aspose.com

Chart problem: output file does not equal to input

How the problem is reproduced:
1)XLSX file with the chart. Axis titles are absent (deleted or made invisible).
2)Load file into library and call getters on possible chart Titles.
3)save it back.
4)Observe appearance of hidden in original file titles.

Attached file and screenshots; code snippet is below:

public static void main(String[] args) throws Exception
{
final String prefixForModfied = “modified_”;
Workbook workbook = new Workbook(testFileDirectory + testFileName);
Iterator sheetIterator = workbook.getWorksheets().iterator();
while (sheetIterator.hasNext())
{
Worksheet worksheet = sheetIterator.next();

Iterator chartIterator = worksheet.getCharts().iterator();
while (chartIterator.hasNext())
processChart(chartIterator.next());
}
workbook.save(testFileDirectory + prefixForModfied + testFileName, FileFormatType.XLSX);

}

private static void processChart(Chart chart) throws Exception
{
SeriesCollection legendCollection = chart.getNSeries();
for (int legendIndex = 0; legendIndex < legendCollection.getCount(); legendIndex++)
legendCollection.get(legendIndex).getName();
Title tmpString = chart.getCategoryAxis().getTitle();
if (chart.getValueAxis().isVisible())
tmpString = chart.getValueAxis().getTitle();
if (chart.getSecondValueAxis().isVisible())
tmpString = chart.getSecondValueAxis().getTitle();
if (chart.getSecondCategoryAxis().isVisible())
tmpString = chart.getSecondCategoryAxis().getTitle();
if (chart.getSeriesAxis().isVisible())
tmpString = chart.getSeriesAxis().getTitle();
tmpString = chart.getTitle();
}

Hi,


Thanks for the sample files.

After an initial test as I have tested your case/issue, I found the issue as you mentioned. The axis titles do appear in the output Excel file after running the sample code with your template file. You are right, when simply getting the titles might show them in the output file. I have logged a ticket with an id “CELLSJAVA-40557” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.


Hi,

Thanks for your posting and using Aspose.Cells for Java.

We have fixed incorrect title issue when save to the xlsx excel file.

Please download and try this fix: Aspose.Cells for Java v7.5.1.2 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40557) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan