Free Support Forum - aspose.com

Converting XLS to PDF chart problem

I am converting a XLS to PDF. There is a chart in the worksheet that has the scale automatically set. When the resulting bmp file gets generated for the pdf, the scale is not carried over from the worksheet. Am I missing a step?

Here is my test code:

Aspose.Cells.Workbook book = new Aspose.Cells.Workbook();
book.Open(“c:/test.xls”);
book.Save(“c:/testxls.xml”, Aspose.Cells.FileFormatType.AsposePdf);
Aspose.Pdf.Pdf pdf2 = new Aspose.Pdf.Pdf();
pdf2.BindXML(“c:/testxls.xml”, null);
pdf2.Save(“c:/test2.pdf”);

I have also attached the generated bmp and the original worksheet.

Thanks,

Will

Hi,

Thanks for providing the template files.

We have checked and found an issue related the output chart image for the designer chart. We will fix it soon.

Thank you.

Hi,

Please try this fix.

There is still bug in converting this chart to image.We could not get the same min value of the category axis.We are looking into this issue.

Please set the min value of category axis in Ms Excel.

Or set it by yourself with codes. See following codes:

Aspose.Cells.Workbook book = new Aspose.Cells.Workbook();
book.Open("c:/test.xls");

book.Worksheets[0].Charts[0].CategoryAxis.MinValue = 1960;
book.Save("c:/testxls.xml", Aspose.Cells.FileFormatType.AsposePdf);
Aspose.Pdf.Pdf pdf2 = new Aspose.Pdf.Pdf();
pdf2.BindXML("c:/testxls.xml", null);
pdf2.Save("c:/test2.pdf");

That looks like that is working better. I did notice one other problem. Why is the chart on both pages?

Hi,

Thanks for reporting,

We will check it and get back to you soon.

Thank you.

Hi,

Please try this fix.

There is an error about setting repeated rows in the old version.

Looks good. Thanks!


Will