开发者

GWT: How do I read an Excel file that is included in my src folder?

开发者 https://www.devze.com 2023-03-17 07:12 出处:网络
I am trying to program in GWT (using Eclipse and the GWT Designer). I would like to be able to take an Excel file that I have already imported into my source folder, read it, and process the data. The

I am trying to program in GWT (using Eclipse and the GWT Designer). I would like to be able to take an Excel file that I have already imported into my source folder, read it, and process the data. The data will be both text and numbers, but I am comfortable doing the conversions from String to other types.

I have seen something about RequestBuilder, but I'm not sure how to use that to re开发者_如何转开发ad Excel. Or, is there another/better way to do this?

I am willing to convert the Excel file into something like a CSV is that is necessary.


You'll probably want to do the processing in your servlet with something like

http://jexcelapi.sourceforge.net/ or http://poi.apache.org/


I am not sure if this is clear enough to you, but it is not possible to process the excel file in GWT at least not directly.
You have to process it on the backend/server. It can't be done on he client side because even if you put the excel file in your source folder it is not available to the GWT compiled javascript code on the client machine.
If you use Java on your backend/server you can use one of the libraries danb suggested to process it on the server and then use RequestFactory or RPC to transmit it to the client/browser for further processing/displaying.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号