Export to PDF chart different from Excel version

There is a discrepancy between the way a chart is being rendered in Excel vs. PDF. I am attaching 2 samples, the excel version and the pdf version. Both files were generated using Aspose.Cells. Note the bottom right Long/Short Exposure chart.

Hi,

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

Please download and try the latest version:
Aspose.Cells
for .NET v7.2.0.4
and let us know your feedback.

If the problem still occurs, then we need your source xls/xlsx file and the code to replicate this issue.

We can see the discrepancies in bottom right Long/Short Exposure chart but these are your output files.

Hi,

After an initial test, I can notice the issue as you have mentioned by simply converting your template Excel file to PDF. The bottom chart i.e. "Long/Short Exposure" is not rendered fine.

I have logged a ticket for it with an id: CELLSNET-40639. We will look into it soon.

Thank you.

Has this been fixed yet?

Hi,

I have tested your issue with the latest version:
Aspose.Cells
for .NET v7.2.0.6
and found, issue still exist.

Please see the code below. I have also attached the screenshot for a reference.

Please check both the code and screenshot and let me know if I am missing anything.

Source File: 14921.xls

Output File: 14921.xls.out.pdf

I have logged your comment in our database against the issue id: CELLSNET-40639

Hopefully your issue will be fixed soon.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\14921.xls”;


//Create a workbook object from the template file

Workbook workbook = new Workbook(filePath);


workbook.Save(filePath + “.out.pdf”);


Screenshot:

Hi,

It seems like it is a bug of Ms-Excel 2010, because Excel 2003 is showing your source file fine.

The generated chart image is same as the chart opening with Excel 2003.

Please see the screenshot for your reference:

Screenshot:

Hi,


After further investigation, we come to know if you could open your source file (14921.xls) into MS Excel 2003, the generated chart image is same as the chart(Excel
2003), see the screen shot attached here, so it is not an issue. The charts’ images would be rendered same as Excel 2003 for XLS file format. If the file format is XLSX, then the charts’ images would be rendered as Excel 2007/2010 charts.

Thanks for your understanding!

This is definitely still an issue and has nothing to do with a bug in Excel 2010. The PDF that I attached was generated by creating an Excel document in memory using Aspose.cells and then rendering it to PDF directly, which is where I am seeing the problem. The Excel file that I attached was purely created to demonstrate the discrepancy. I created the Excel file in the same manner, by creating an Excel document in memory using Aspose.cells, but instead of rendering it to PDF, I rendered it to Excel and saved it to disk as an Excel 2010 file (since that is what I have installed on my computer). But since I did not generate the PDF version from an Excel 2010 document, but instead from an Aspose.cells-generated in-memory Excel document, the version of Excel should be irrelevant.

Hi,


I think it is different behavior of different MS Excel versions (2003 Vs 2007/2010) for XLS file format. I think you should try to use XLSX template file instead of XLS and then try to convert it to PDF to see if the issue exists or not.

Thank you.

I saved the template as an Excel Workbook type (.xlsx) and am still seeing the problem. In addition, the footnote text at the bottom lost its font sizing, so that approach leaves me with 2 problems instead of 1. :frowning:

Hi,


Could you attach your XLSX file and output PDF file here, we will look into your issue soon.

Thank you.

Ok. Below is a code snippet from my application, pared down to almost the bare minimum. If you toggle the value of IsExcelOutput between true and false you will get the 2 different output files, Excel and PDF. Note the difference in the Excel and PDF versions of the Long/Short Exposure chart. I have attached a modified template file with some sample data that I created to demonstrate the problem.

//Create an instance of workbook from QuantSheet excel template
var xlt = new WorkbookDesigner();
var wb = new Workbook(Page.MapPath(“QuantSheetTemplate.xlsx”));

xlt.Workbook = wb;
xlt.Process();

if (IsExcelOutput)
{
//Output workbook to Excel using Aspose.Cells
wb.Save(Page.Response, “QuantSheet.xls”, ContentDisposition.Attachment, new XlsSaveOptions());
}
else
{
//evaluate worksheet formulas (otherwise they won’t be represented in the pdf output)
wb.CalculateFormula();
//make all sheets invisible except for the first worksheet
for (int i = 1; i < wb.Worksheets.Count; i++)
wb.Worksheets[i].IsVisible = false;
wb.Save(this.Response, “QuantSheet.pdf”, ContentDisposition.Attachment, new PdfSaveOptions());
}

Hi,

Thanks for your elaboration and providing us your source file and the source code to replicate this issue.

We will look into your issue and provide a fix soon.

Any update on this? This is holding up our product release date.

Hi,


I am sorry but we don’t have any update about the resolution of this issue from our development team. I have forwarded your concerns to our development team and, as soon as we get an update, will update you here.

I appreciate your patience for the resolution of the issue

Hi,

I have tested your issue with the latest version:
Aspose.Cells
for .NET v7.2.1.1
and I found that issue still exists.

I have tested this issue with the following code. I have attached the source xlsx file and the output pdf with this post.

Please also see the screenshot for explanation of this bug.

We have logged your comment in our database against the issue id: CELLSNET-40639

Hopefully, this bug will be fixed soon.

C#


string filePath = @“F:\QuantSheetTemplate.xlsx”;


Workbook workbook = new Workbook(filePath);


workbook.CalculateFormula();


workbook.Save(filePath + “.out.pdf”);


Screenshot:

Hi,

We have fixed the bug for area chart that has null values in the source data.

Please download and try the latest fix: Aspose.Cells for .NET v7.2.1.3

I am not seeing anything different in version 7.2.1.3. It is still doing the same thing. Did you verify the fix against my sample code with spreadsheet?

Actually, I managed to get it working. It seems the template file must end in xlsx instead of xls. Otherwise the fix doesn’t work. I don’t know if this is expected behavior or not, but it doesn’t seem right to me. But at least I got it working so I’m ok for now.

Hi,

Thanks for your feedback.

It’s good to know that part of your issue is now resolved.

We will look into your comment and fix the remaining issues.