Problem:
One, the cell or column is a formula, the readout value is 0
Aspose.cells 4.4.0.5 version because it is too low to read the xmls suffix of the Excel file, it is found that if this column is calculated by the formula, the value is not obtained. The value obtained is always 0
Second, the upgrade can solve the problem. But there will be problems like
1, style use change big
If you upgrade aspose, this issue can be resolved. But there are a lot of places to make changes.
2, go to PDF printing has a problem
If you have a good excle-to-pdf aspose generated, print it. There will be broken pages, line adaptive method, the excle display is normal, but printed out after the display is not complete.
I tried it. 7.2.1.0 version 5.3.1.0 version, the higher the version, the more problematic the printing.
Three, solve.
Just use the Microsoft.Office.Interop.Excel.dll 12.0 version on the line. This thing has been added in the reference. Net. Then use my code below to turn xmls into XML. The original thing doesn't have to change
/// <summary> ///Convert Excel format/// </summary> /// <param name= "Strsavepath" >Original Path</param> /// <returns>New Path</returns> Public Static stringConvertexcel (stringStrsavepath) { stringstrpath =string. Empty; //convert an XML file to a standard Excel formatObject nothing = System.Reflection.Missing.Value;//because many values of yongcom components need to be replaced with Missing.ValueExcel.Application Exclapp =NewExcel.applicationclass ();//InitializeExcel.Workbook Excldoc = ExclApp.Workbooks.Open (Strsavepath, nothing, nothing, nothing Nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing);//Open the excl working thinFileInfo Exportfile =NewFileInfo (Strsavepath); if(ExportFile.Extension.Equals (". xlsx", StringComparison.OrdinalIgnoreCase)) {strpath= ExportFile.FullName.Replace (Exportfile.extension,". xls"); if(File.exists (strpath)) {file.delete (strpath); } } Try{Object format= Excel.XlFileFormat.xlWorkbookNormal;//Get excl 2007 file format this is not a tube, use this, for others may not. Exclapp.displayalerts =false; Excldoc.saveas (strpath, format, nothing, nothing, nothing, nothing, Excel.XlSaveAsAccessMode.xlExclusive, nothing, Nothing, nothing, nothing, nothing);//Save As Excl 2007 format } Catch(Exception ex) {} excldoc.close (Nothing, nothing, nothing); Exclapp.quit (); returnstrpath; }
Convert Excel format
Excle,aspose.cells Formula field value does not take xmls to XML