poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59639] org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException
Date Mon, 30 May 2016 10:22:19 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=59639

--- Comment #2 from ankita <ankita.naik@synechron.com> ---
(In reply to Dominik Stadler from comment #1)
> What about "and attach a file that triggers it"? Without it there is not
> much we can do...

Following method is generating issue:
It is Write On Excel file

public void writeMethod() throws FileNotFoundException, IOException{

            String dataToWrite[]={"Pass"};    
            //FileInputStream inputStream=new
FileInputStream("C:\\Users\\Ankita.Naik\\workspace\\Selenium_Practice\\src\\AddPatient_Excel\\A.xlsx");

            XSSFWorkbook workbook=new XSSFWorkbook(new
FileInputStream("C:\\Users\\Ankita.Naik\\workspace\\Selenium_Practice\\src\\AddPatient_Excel\\A.xlsx"));
            XSSFSheet sheet=workbook.getSheetAt(0);
            int rowcount=sheet.getLastRowNum()-sheet.getFirstRowNum();

            //Row row=sheet.getRow(0);
            //Row newRow=sheet.createRow(rowcount+1);

            for(int i=0;i<rowcount;i++)
                {
                    Row row=sheet.getRow(i);
                    Cell cell=row.createCell(3);
                    cell.setCellValue(dataToWrite[i]);
                }

            workbook.close();
            FileOutputStream outputStream=new
FileOutputStream("C:\\Users\\Ankita.Naik\\workspace\\Selenium_Practice\\src\\AddPatient_Excel\\A.xlsx");
            workbook.write(outputStream);
            outputStream.close();

    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message