JSP生成Excel电子表格(XLS)进行下载 [英] JSP generating Excel spreadsheet (XLS) to download
问题描述
tomcat只是写一个文件,就像它是一个普通的Java应用程序,然后生成一个链接到这个文件?还是需要使用特定的API?
在执行此操作时,我有权限出现问题吗?
您可以使用完整的库,如 JExcelAPI ,如果您设置响应,Excel还将读取CSV和纯HTML表MIME类型类似于application / vnd.ms-excel。
根据电子表格的复杂程度如何,CSV或HTML可以为您做这项工作,而无需第三方图书馆。
I have this application I'm developing in JSP and I wish to export some data from the database in XLS (MS Excel format).
Is it possible under tomcat to just write a file as if it was a normal Java application, and then generate a link to this file? Or do I need to use a specific API for it?
Will I have permission problems when doing this?
While you can use a full fledged library like JExcelAPI, Excel will also read CSV and plain HTML tables provided you set the response MIME Type to something like "application/vnd.ms-excel".
Depending on how complex the spreadsheet needs to be, CSV or HTML can do the job for you without a 3rd party library.
这篇关于JSP生成Excel电子表格(XLS)进行下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!