Export HTML table to Excel - using jQuery or Java

前端 未结 9 1713
慢半拍i
慢半拍i 2020-12-06 07:13

I\'ve a HTML table on my JSP page, that I want to be exported to Excel on a button click.

What would be the best way of going about this?

(For ex., how would

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 07:24

    Rather export to CSV format. It's supported by Excel as well. Exporting to a fullworthy XLS(X) format using for example Apache POI HSSF or JExcepAPI is slow and memory hogging.

    Exporting to CSV is relatively simple. You can find a complete code example in this answer.


    As to exporting to files using JavaScript, this is not possible without interaction of Flash or the server side. In Flash there's as far only the Downloadify library which can export to simple txt files. Further, ExtJs seems to have a CSV export library, but I can't find any feasible demo page.

提交回复
热议问题