2

I am new to Jsp. I am developing the tool for testing usage, and have succeeded to open the excel file in the browser from the jsp application. However, i am not able to modify or edit the opened excel sheet.

Please help how to modify the excel in the browser.

2 Answers 2

4

You cannot do this when displaying the file inline in a browser or doing a 'Open file' when getting a download popup. Simply because the file is then copied into client's disk file system. If you save the edits, it's saved in the same copy on the client's disk file system. This does not affect the original file in the server side in any way.

There are basically 2 ways to achieve your requirement:

  1. Let client download a copy of the excel file and store it in the client side disk file system, so that the client can edit and save it locally. Give the client the possibility to upload the edited file back. In the server side just replace/backup the original file.

  2. Use HTML forms the smart way to mimic an Excel sheet and use a Java Excel API (Apache POI, JExcelAPI, etc) to map between this data and the actual Excel file which is stored in the server side disk file system.

2

Have you looked at JExcel?

The FAQs also explain how to use the API with jsp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.