Issue in Labels' Positions When saving as ByteArray and Reconstructing the Workbook Object

Hi Aspose.Cells,

package AsposeCellsExamples.Charts;

import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

public class SaveTest {
  public static void main(String[] args) throws Exception {
    String path = "C:\\Users\\Tests\\"; //replace the path wrt your machine
    Workbook workbook = new Workbook(path + "source-xl-with-labels.xlsx");
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    workbook.save(baos, SaveFormat.XLSX);
    System.out.println(baos);
    Workbook finalWorkbook = new Workbook();
    finalWorkbook.getWorksheets().removeAt(0);
    Workbook workbook2 = new Workbook(new ByteArrayInputStream(baos.toByteArray()));
    finalWorkbook.combine(workbook2);
    finalWorkbook.save(path + "out-file.xlsx", com.aspose.cells.SaveFormat.XLSX);
  }
}

With the above Program, we are trying to read an already saved Excel file, save it in ByteArrayOutputStram and saving it again as a excel file.
Chart in the source-xl-with-labels.xlsx : image.png (7.4 KB)
Chart in the out-file.xlsx: image.png (11.4 KB)
all labels are coming at bottom of the chart unlike the original we read at start.

We have a requirement to save the file as ByteArray and then reconstruct the file again. It’s causing issue there.

System Configurations:
OS: Windows 10 - 64Bit
CPU & RAM: Intel i7-1265U & 16GB (JVM Heap Size given is 1GB)
JDK & Aspose.cells: [ Aspose.cells 24.5 with JDK 21 ] & [ Aspose.cells 23.8 with JDK 11] (checked with these two configs, issue is there in both)

attached the excel files as zip
excel files for Labels issue.zip (21.2 KB)
Could you help on this issue

@ashok.kumar.r,

Thanks for the sample files and screenshots.

After an initial test, I am able to reproduce the issue as you mentioned by using your template XLSX file and sample code segment. I found the issue in labels’ positions when saving as ByteArray and reconstructing the Workbook object.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45993

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@ashok.kumar.r,

We are pleased to inform you that your issue (logged earlier as “CELLSJAVA-45993”) has been resolved. The fix will be included in our upcoming release (Aspose.Cells v24.6) that we plan to release in the first half of June 2024. You will be notified when the next version is released.

1 Like

The issues you have found earlier (filed as CELLSJAVA-45993) have been fixed in Aspose.Cells for Java 24.6.

1 Like

Thanks @amjad.sahi

@ashok.kumar.r,

You are welcome.