【发布时间】:2015-06-03 07:29:54
【问题描述】:
我的要求是将报告数据从 Web 查看器导出为 xlsx 格式。但是 xlsx 选项根本没有出现在导出对话框中。 我正在使用码头网络服务器和 birt 运行时 4.2.2。
下面是 /root/pr/lib/birt-runtime-4_2_2/birt/webcontent/birt/pages/dialog/ExportReportDialogFragment.jsp 中的相关代码段(我根据另一篇文章修改了它以查看 xlsx 选项StackOverflow.com)。
<%
<%-- String[] supportedFormats = ParameterAccessor.supportedFormats; --%>
String[] supportedFormats = {"pdf","xls","xlsx"};
%>
<TABLE CELLSPACING="2" CELLPADDING="2" CLASS="birtviewer_dialog_body">
<TR HEIGHT="5px"><TD></TD></TR>
<TR>
<TD>
<label for="exportFormat"><%=BirtResources.getMessage( "birt.viewer.dialog.export.format" )%></label>
<SELECT ID="exportFormat" NAME="format" CLASS="birtviewer_exportreport_dialog_select">
<%
ParameterAccessor.sortSupportedFormatsByDisplayName(supportedFormats);
for ( int i = 0; i < supportedFormats.length; i++ )
{
%>
<OPTION VALUE="<%= supportedFormats[i] %>"><%= ParameterAccessor.getOutputFormatLabel( supportedFormats[i] ) %></OPTION>
<%
}
%>
</SELECT>
</TD>
</TR>
在 /root/pr/lib/birt-runtime-4_2_2/birt/WEB-INF/viewer.properties 中,我在适当的位置添加了以下 2 行。
viewer.extension.xlsx=xlsx, viewer.label.xlsx=XLSX
但在 web 查看器中仍然没有 xlsx 选项。 你能帮我找到出路吗?
【问题讨论】:
标签: export-to-excel birt