1
votes

My requirement is to export the report data from web viewer to xlsx format. But xlsx option is not coming at all in export dialog. I'm using jetty web server and birt runtime 4.2.2.

Below is the relevant piece of code in /root/pr/lib/birt-runtime-4_2_2/birt/webcontent/birt/pages/dialog/ExportReportDialogFragment.jsp (which I modified to view xlsx option as per another article in 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>

And in /root/pr/lib/birt-runtime-4_2_2/birt/WEB-INF/viewer.properties, I've added below 2 lines at proper place.

viewer.extension.xlsx=xlsx, viewer.label.xlsx=XLSX

But still in web viewer the xlsx option is not coming. Could you please help me to find any way out ?

2

2 Answers

1
votes

Here, I've found a solution to my question. Firstly, to integrate birt 4.4.2 with jetty and to replace to older version, we need to replace all old version birt jars from application's WEB-INF/lib directory with new version birt jars. It is better to take a backup of WEB-INF/lib directory before deleting all old version jars from lib directory and putting new jars instead. Secondly, we need to put the new birt-runtime directory (e.g. birt-runtime-4_4_2) into application's "lib" directory (where the old birt-runtime directory should also reside) and refer these new jars from eclipse java build path and remove the old birt-runtime jar references. Make a minor change to compile the birt-chart newly and run to get the desired result. After this, rename or remove the old birt-runtime directory from application's "lib" directory, where both the old and new runtime directories are residing.

0
votes

XLSX emitter has been included in BIRT 4.3, so even by changing JSP pages and .properties files it can't work with a 4.2.2 runtime.

An option would be to include the spudsoft emitter by your own in your existing birt install, but this is complicated, you would better upgrading to a recent version such BIRT 4.4.2.