2017-01-10 2 views
-1

Dès que fileouttream est exécuté, il change le format de fichier. Ci-dessous mon code:FileOutputStream webdata = nouveau FileOutputStream();

FileInputStream input=new FileInputStream(path); 
System.out.println("input"); 
XSSFWorkbook wb=new XSSFWorkbook(input); 
System.out.println("wb"); 
XSSFSheet sh=wb.getSheet("Sheet1"); 
System.out.println("sh"); 
XSSFRow row=sh.getRow(2); 
System.out.println("row"); 
FileOutputStream webdata=new FileOutputStream(path); 
System.out.println("wedata"); 
row.createCell(2).setCellValue("hi"); 
System.out.println("print"); 
wb.write(webdata); 
System.out.println("end"); 

org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException

+0

D'où provient l'exception? – EJP

Répondre