Skip to Content
avatar image
-1
Former Member

how to read and write excel file using apache poi? this program would run on Hana cloud platform.

In local program is recognizing file name. But it isn't working when it is deployed on SCP. I need help in understanding.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 24 at 09:56 AM

    I did use InputStream rather than filename. It started working fine.

    final InputStream fileInput = filePart.getInputStream();

    XSSFWorkbook workbook = new XSSFWorkbook(fileInput);

    Thank you,

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 24 at 01:50 AM

    Hello, Shaik. It there an error message show up? I think you should check your file path It might be the program is not able to find the excel files. thanks

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member
      org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file input stream from file: 'TestExcel.xlsx' is the ERROR on SCP. Same program works fine in local host. I'm providing file name as input "XSSFWorkbook workbook = new XSSFWorkbook(new File(fileName))". 
      Program is deployed on SCP from Eclipse I'm running on SCP.