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

Free Support Forum - aspose.com

Excel File Merger issue

getting below error while merging :-


ERROR [ExcelMerger:230]: java.lang.NumberFormatException: For input string: "Infinity"
java.lang.NumberFormatException: For input string: “Infinity”
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:441)
at java.lang.Long.parseLong(Long.java:483)
at com.aspose.cells.b.a.zp.a(Unknown Source)
at com.aspose.cells.zaor.b(Unknown Source)
at com.aspose.cells.zaor.a(Unknown Source)
at com.aspose.cells.zaor.a(Unknown Source)
at com.aspose.cells.zadr.a(Unknown Source)
at com.aspose.cells.zadr.A(Unknown Source)
at com.aspose.cells.zadr.z(Unknown Source)

Aspose version:- aspose-cells-8.4.1.4.jar
Java Version:- jdk1.7.0_71

below is the merger code to replicate the issue:-

import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import com.aspose.cells.License;
import com.aspose.cells.Workbook;




public class TestExcel {


public static void main(String[] args) {
License license = new License();
try {
license.setLicense(new FileInputStream(“D:\NavPack_Devel\conf\Aspose.Cells.lic”));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String path=“Z:\My Documents\ASPOSE issue\”;

File clientDir = new File(path);
File[] list = clientDir.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return (pathname.getName().endsWith(“xlsx”));
}
});
Workbook SourceBook1= new Workbook();
Workbook SourceBook2= new Workbook();
for ( int i = 0; i < list.length; i++) {
System.out.println(list[i].getName());
try {
SourceBook1 = new Workbook(path+list[i].getName());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
SourceBook2.combine(SourceBook1);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
SourceBook2.save(path+“combine.xlsx”);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

}
}


Highlighted exponential values in attached file name “test1.xlsx”, columns O, and Y are causing the problem.

Hi,


Thanks for providing us template file and sharing sample code.

After an initial test, I observed the issue as you mentioned. I found an exception: java.lang.NumberFormatException: For input string: “Infinity” when merging Excel documents using your sample code (in licensed mode) with your template file. I do not get exception if I do not set the license. Moreover, it produces a corrupt output file and when it is opened into MS Excel, MS Excel prompts an error and has to repair it.

I have logged a ticket with an id “CELLSJAVA-41511” 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,

This is to inform you that we have fixed your issue CELLSJAVA-41511 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Thank you.

Hi,

Please try our latest version/ fix: Aspose.Cells for Java (Latest Version)

Your issue should be fixed in it.

Let us know your feedback.

Thank you

Hi Amjad,

I am unable to download the file that you provided.
when clicked on the file getting below error:-

Not Found: Forum Not Found

The forum you requested does not exist.

please advise at the earliest

Hi,


Well, it woks fine, I tested by clicking on the link Aspose.Cells for Java v8.6.0.4 in my previous post, it downloaded the file fine. Could retry it again.

I have also attached the zipped archive for Aspose.Cells for Java v8.6.0.4 for your needs.

Let us know if you still have any issue.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-41511) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.