Skip to Content
-1

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

Jan 23 at 01:41 PM

59

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

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

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

final InputStream fileInput = filePart.getInputStream();

XSSFWorkbook workbook = new XSSFWorkbook(fileInput);

Thank you,

Share
10 |10000 characters needed characters left characters exceeded
Richard Zhao
Jan 24 at 01:50 AM
0

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

Show 1 Share
10 |10000 characters needed characters left 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. 
0