Problem with chart layout when exporting to PDF

Hi,

I'm having another issue saving sheets that contains charts to pdf.

The chart in the pdf file looks different than the origunal chart in the excel file.

In this case the vertical axys is inverted, the horizontal axys changed the scale and not all values are shown in the pdf.

The sample files are attached: the excel workbook, the pdf generated by aspose and the pdf generated by excel.

The code that generated the excel file is:

string filePath = "mypath";
Workbook workbook =
new Workbook(filePath);
workbook.Save(filePath + ".
out.pdf", SaveFormat.Pdf);

Thank you.

Hi,

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

We were able to replicate this issue using the latest version: Aspose.Cells
for .NET v7.3.5.1
with your given code.

We have attached the output file generated by this code and screenshot highlighting the problems with red markings for a reference.

C#


string filePath = “F:\Shak-Data-RW\Downloads\sheet.xlsx”;

Workbook workbook = new Workbook(filePath);

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


Screenshot

Hi,

Thank you again for the reply.

Any idea of when these problems with exporting workbooks to pdf will be fixed?

We are currently working on a project that will involve sending reports to our customers, and it is using aspose cells to generate both the excel sheets and pdf reports.

It is extremely important to us to have total control over the layout of the excel and pdf files, and that the generated pdf file looks exactly like the origin excel file, especially the charts.


Thank you.v

Hi,


We consider your concerns.

We are working over your issue. I have asked the concerned developer to update on it or share any eta if possible.

Once we have any update on it, we will let you know here.

Thanks for being patient!

Hi Amjad,

Any news on this issue? I'm having some problems with this chart, not only when I try to export to pdf, but also when I'm generating the chart.

The chart has two types of series: bars and points

Here are the issues I noticed:

  1. The chart looks different from when I save it straight to pdf than when I save it to excel then open the excel file and save it to pdf. It looks totally different when I save it to excel then reopen the file and save it to pdf. When I save it straight to pdf it looks a little better.
  2. The axis look different when I create it using aspose: both primary and secondary category axis stay on top of the chart. When I create the axis on excel one axis is on top and one is on the botton of the chart. (I'm sending sample files to show the difference)
  3. The chart looks different on the pdf depending if I print the secondary category axis or not. Apparently the point series is only shown on the pdf when I show the secondary axys (only when saving straight to pdf)

I'm also sending attached the code I'm using to populate the chart to help with this issue.

I can send more examples to illustrate the problems above if you want.

Thank you.

Hi,


Thanks for providing us further details and sample code plus files.

I am afraid, your issue is still not resolved. Once we have any update on it, we will let you know here.

Also, I have logged your comments with details/sample files to attach with your existing issue id “CELLSNET-41324”. Our concerned developer will look into it as well.

Thank you.

Hi,

Any news on these issues?

If some of the problems mentioned on the post above is already fixed it would be of great help.

We are almost on our project deadline, and without these problems fixed we can't go any further on the project.

Do you have any ideas of when will you have a new version of the aspose cells library that we can test to check if these problems are fixed?

Thanks a lot for your help.

Hi,

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

We are afraid, there is no update for you at this moment. However, we have logged your comments against this issue.

Once, we will have some update for you, we will let you know asap.

Hi,

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

We have fixed the issue.Now we support 2 axis in one side.

Please download and try this fix: Aspose.Cells for .NET v7.4.2.5 and let us know your feedback.

Hi Shakeel,

Thanks a lot for your reply.

I tested the fix you mentioned, and I noticed the issue is still there.

The desired appearance of the chart generated by aspose is the same of the chart generated by excel.

But in this case, the axis generated by Aspose are on the same side, and the axis created by Excel are on different sides. (Chart Tools > Layout > Axis > Secondary Horizontal Axis > Show standard Axis)


I'm attaching the files to show the difference.


Thank you.

Hi,

Thanks for your posting and using Aspose.Cells.

Please provide us your sample project replicating this issue with the latest version: Aspose.Cells
for .NET v7.4.3.3
. We will look into your project and help you asap.

Hi Shakeel,

Thank you for your reply.

I'm sending attached a sample Project replicating the issue as requested.

Please note that I removed the Aspose.Total.lic file from the solution.

I'm also sending the same excel file created manually by excel to show the diferences.

Thank you for your help.

Hi,

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

We were able to replicate this issue using your sample code with the latest version. In your manually created Excel file, axis are on both sides while in the excel file created by Aspose, both axis are on the same side.

Please see the screenshot for a reference.

This issue has been logged as CELLSNET-41707.

Hi,

Thanks for your posting and using Aspose.Cells.

Please add chart.SecondValueAxis.IsPlotOrderReversed = false; at the last line of createChart() method to make the SecondCategoryAxis lay on bottom side.


Hi Shakeel,

Thank you for your reply.

I managed to solve the problem with the instructions you provided.

I just had to plot the data in a reversed order before using the line chart.SecondValueAxis.IsPlotOrderReversed = false;

Thanks a lot for your help.

Hi,


Good to know that your issue is sorted out.

Feel free to contact us any time, if you need further help or have some other queries or issue(s), we will be happy to assist you soon.

Thank you.