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