Hi Team,
I’m facing an issue while converting the Excel to PDF format.
I have 3 graphs in my Excel but after conversion to PDF I can see only the 1st graph.
Please find attached the sample java code I’m using to convert the Excel to PDF and provide a solution for the same.
Regards,
Sanjeev
Hi,
Thanks for providing us template file and sample code.
After an initial test, I observed the issue as you mentioned. I found that Clustered Bar graphs are not getting displayed in the output PDF file format. I used the following sample code with your template file to reproduce the issue:
e.g
Sample code:
Workbook workbook = new Workbook(“Sample.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(SHEET_NAME_CHART);
PageSetup pageSetup = worksheet.getPageSetup();
PdfSaveOptions saveOptions = new PdfSaveOptions(com.aspose.cells.SaveFormat.PDF);
/Setting Default Font as Calibri on WorkbookEND**********/
saveOptions.setAllColumnsInOnePagePerSheet(true);
saveOptions.setOnePagePerSheet(true);
saveOptions.setCreatedTime(DateTime.getNow());
pageSetup.setLeftMargin(0.5);
pageSetup.setRightMargin(0.5);
pageSetup.setTopMargin(0.5);
pageSetup.setBottomMargin(0.5);
saveOptions.setImageResample(220, 100);
//To avoid overlapping of hint text with Title
// worksheet.getCells().get(“A1”).setValue(null);
worksheet.getCells().deleteRow(0);
workbook.calculateFormula();
workbook.save(“out1Sample_PDFGenerated1.xlsx”);
workbook.save(“out1Sample_PDFGenerated1.pdf”, saveOptions);
e.g
Sample code:
Workbook workbook = new Workbook(“Sample.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(SHEET_NAME_CHART);
PageSetup pageSetup = worksheet.getPageSetup();
PdfSaveOptions saveOptions = new PdfSaveOptions(com.aspose.cells.SaveFormat.PDF);
/Setting Default Font as Calibri on WorkbookEND**********/
saveOptions.setAllColumnsInOnePagePerSheet(true);
saveOptions.setOnePagePerSheet(true);
saveOptions.setCreatedTime(DateTime.getNow());
pageSetup.setLeftMargin(0.5);
pageSetup.setRightMargin(0.5);
pageSetup.setTopMargin(0.5);
pageSetup.setBottomMargin(0.5);
saveOptions.setImageResample(220, 100);
//To avoid overlapping of hint text with Title
// worksheet.getCells().get(“A1”).setValue(null);
worksheet.getCells().deleteRow(0);
workbook.calculateFormula();
workbook.save(“out1Sample_PDFGenerated1.xlsx”);
workbook.save(“out1Sample_PDFGenerated1.pdf”, saveOptions);
I have logged a ticket with an id “CELLSJAVA-41667” 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,
Please try our latest version/fix: Aspose.Cells for Java v8.6.3.6 (attached).
We have fixed your issue now.
Let us know your feedback.
Thank you.
The issues you have found earlier (filed as CELLSJAVA-41667) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.