We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cells content removed when opening XLSX files with aspose cells

Hi all,

I open an Excel file with Aspose Cells, then I save it in PDF format. The code is simple:

Dim AWB As Aspose.Cells.Workbook = New Aspose.Cells.Workbook()
AWB.Open(strFileName)
AWB.Save(strFileNamePDF, Aspose.Cells.FileFormatType.Pdf)

In the output files somme cells are empty (like cell U11 in attached file). I know that the cell content is very complex:
{=XIRR(IF(FUNDNAME_LVL0_SI=$M11,OFFSET(INDIRECT(CONCATENATE(U$9,CONCATENATE(ADDRESS(ROW(HEADER_SI),MATCH(CONCATENATE(U$8,H11),HEADER_SI,0))))),1,0,NBLINES_SI),IF(FUNDNAME_LVL0_SI="DEFAULT_CASHFLOW",OFFSET(INDIRECT(CONCATENATE(U$9,CONCATENATE(ADDRESS(ROW(HEADER_SI),MATCH(CONCATENATE(U$8,H11),HEADER_SI,0))))),1,0,NBLINES_SI),0)),IF(FUNDNAME_LVL0_SI=$M11,OPERATION_DATE_SI,IF(FUNDNAME_LVL0_SI="DEFAULT_CASHFLOW",OPERATION_DATE_SI,$A$3)),IF($T11>=1,0.1,-0.1))}

Do you know if there is a turnaround, or if this issue is planed to be fixed in next releases ?

Thanks

Hi,


Thanks for providing the template file.

Please download and try our latest fix/version: Aspose.Cells for .NET v7.5.0.4 I have tested your scenario with it and it works fine. The cell formulas are evaluated fine and values are calculated fine to be rendered into PDF file.

Sample code:

//…
Dim AWB As Aspose.Cells.Workbook = New Aspose.Cells.Workbook(strFileName)
AWB.Save(strFileNamePDF, Aspose.Cells.FileFormatType.Pdf)

I have also attached the output file for your reference.

Thank you.

Thanks for your answer.

Unfortunately, I still have an isue on my side. The value of IRR cells is not the same in XLSX file and PDF file (15.1 in XLSX and 4.7 in PDF).

I attach the 2 files.

Regards

Hi,


Well, I have tested and it works fine. It looks like you might be using some older version in your project. Please make sure to use Aspose.Cells for .NET v7.5.0.x, I shared the link (for the fix) in my previous post, please try it and let us know your result. For confirmation, you may print the version number that is being used in your project, see the document for your reference:
http://www.aspose.com/docs/display/cellsnet/Check+Version+Number+of+the+Component

e.g
Console.WriteLine("Assembly Version Info: " & CellsHelper.GetVersion())

Hi,

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

Please use the workbook.CalculateFormula() method and your pdf will have correct values. We have generated the output pdf with the following code and found no issue. We have attached the output pdf file for your reference.

Please also download and try the latest version: Aspose.Cells
for .NET v7.5.0.5
.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\test+aspose+pdf.XLSX”;


Workbook workbook = new Workbook(filePath);

workbook.CalculateFormula();

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

Thanks.

You are right! I was missing CalculateFormula. Even with my 'older' version (7.4.3) it works now!

Thanks again.