Chart is overlapping with cell's data

Hi Team,

When we are trying to convert the attached excel the data of cells is overlapping with Chart.
Please can you look at this issue.

For your reference I have attached a sample file and snapshot of PrintPreview.

Thanks,
Ashish Sharma

Hi,


Thanks for the template file and screen shots.

After an initial test, I observed the issue as you mentioned via your attached screen shots. I found the chart is overlapping with cell’s data in the converted PDF file via Aspose.Cells APIs, I used your template file in the conversion. I have logged a ticket with an id “CELLSNET-43247” 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,

The source file you provided is strange. It’s different when we open in Excel 2003 and Excel 2010. Please refer to the attachments.

For this case, we follow the specification that makes .xls to be the same as Excel 2003 and .xlsx same as Excel 2010.

You may set the size of plot area to make the text not overlapping before converting the file to PDF or image.

Chart chart = book.Worksheets[0].Charts[0];

chart.PlotArea.Height = 4000;

Thank you.

Hi

Thanks for the workarond, but this will only work if we know the size of each and every chart in each excel file (It may happen that the workaround that you have provided will work for this xlsx file may not work for other files,it will not be feasible for us to change the code for this excel file.)

I have also tried with "XLSX" version of the same file.
But Aspose is sill not able to generate the pdf correctly(still some text is overlaping with chart.)

For you reference I have attached sample file.

Thanks,
Ashish

Hi,


Thanks for the template files.

Please try our latest version/fix: Aspose.Cells
for .NET v8.3.1.3

I have tested your scenario/ case by simply opening your newly attached file and converting to PDF via Aspose.Cells API, it works fine. I have attached the output file for your reference here.

Thank you.
<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-SG;mso-fareast-language:
EN-SG;mso-bidi-language:AR-SA”>

Hi

we are using 8.3.2.1 Aspose.Cells still it is not giving expected output.

Thanks,
Ashish

Hi,


I have tested your scenario/ case using your template XLSX Excel file with our latest version/fix: Aspose.Cells for .NET v8.5.1.5, it works fine. I got the expected results in the output PDF file. Please try Aspose.Cells for .NET v8.5.1.5.

Thank you.

Hi
Earlier you have mentioned "Aspose.Cells for .NET v8.3.1.3" version which include the fix but looks like this version did not had the fix for the problem mentioned.

Also the latest version does not work for us can take a look the below code :-
 MemoryStream toBeConvertedToPdf = new MemoryStream(File.ReadAllBytes(@"C:\ChartOverlappingWithData.xls"));
 MemoryStream pdfStream = new MemoryStream();
 Workbook originalWorkbook1 = new Workbook(toBeConvertedToPdf);
 Aspose.Cells.PdfSaveOptions saveOptions = new Aspose.Cells.PdfSaveOptions(Aspose.Cells.SaveFormat.Pdf);
 originalWorkbook1.Save(pdfStream, saveOptions);
 File.WriteAllBytes(@"C:\ChartOverlappingWithData.pdf", pdfStream.ToArray());

Thanks,
Ashish 

Hi,

I am afraid, we cannot fix the issue regarding your XLS file format (there is no issue with XLSX file format). We analyzed earlier and we found the source file you provided is strange. It’s different when we open it in MS Excel 2003 and MS Excel 2010. Please refer to the attachments here:

For this case (XLS file format), we follow the specification that makes .xls to be the same as Excel 2003 and .xlsx same as Excel 2010.

We think you may set the size of plot area to make the text not overlapping before converting the file to PDF or image.
e.g.
Sample code:

Chart chart = book.Worksheets[0].Charts[0];<o:p></o:p>

chart.PlotArea.Height = 4000;

Thank you.