【发布时间】:2012-03-18 08:19:12
【问题描述】:
(已编辑)好的,让我更好地解释一下。我有搜索页面,它根据不同的搜索条件查找员工。现在(由于 QA 阶段发生范围蔓延)我想添加一个导出按钮,它将过滤的员工列表保存在 MS-Excel 表单中。我一直在研究 Birt 报告设计,但我认为这就是我正在寻找的,因为它试图建立一个独立的报告。我只想将 JSP 页表中显示的内容保存为 excel。
<div id="searchResultsContents">
<p>Search Results:</p>
<display:table class="cspTable"name="searchEmployees" sort="list"
pagesize="10" requestURI="employeeSearch.html" cellspacing="0" cellpadding="0"
defaultsort="1" defaultorder="ascending">
<display:column property="fullName" title="Name" class="namesColumn"
sortable="true" href="showUser.html" paramId="employeeId"
paramProperty="employeeID" />
<display:column property="occupationalTitle.titleName" title="Title"
sortable="true" />
<display:column property="email" title="Email"
sortable="true" />
<display:column property="cycle.cycleName" title="Cycle"
sortable="true" />
<display:column property="realLocation.code" title="Location"
sortable="true" />
<display:column property="hireDate" title="Hire Date"
sortable="true" />
</display:table>
</div>
</div>
谢谢
【问题讨论】:
-
仅供参考 - 下载始终来自服务器。您需要创建一个 Servlet,将数据流回浏览器。通常我只做一个 CSV,但如果你想要 XLSX,你可能需要模仿它使用的 XML 格式...what have you tried?
标签: javascript spring jsp jakarta-ee jquery