I am trying to export Crystal Report to Excel format in my
JSP...
It works for PDF,
RTF, MSWord formats, but when I'm trying to do the same for Excel - I am getting "Invalid post back event : {0}" message coming from com.crystaldecisions.report.web.viewer.ReportExportControl
Can not understand what I am doing wrong... Please, help! Thanks!
This is my JSP code:
<%@ page
import="com.crystaldecisions.reports.reportengineinterface.*,
com.crystaldecisions.report.web.viewer.*,
com.crystaldecisions.sdk.occa.report.exportoptions.*,
com.crystaldecisions.sdk.occa.report.data.*,
com.crystaldecisions.sdk.occa.report.reportsource.*" %>
<%
ReportExportControl exportControl = new ReportExportControl();
IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
exportControl.setReportSource(rptSrcFactory.createReportSource(
"ReportForTst.rpt", request.getLocale()));
ExportOptions exportOptions = new ExportOptions();
exportOptions.setExportFormatType(ReportExportFormat.MSExcel);
ExcelExportFormatOptions xlexpopts = new ExcelExportFormatOptions();
xlexpopts.setStartPageNumber(1);
xlexpopts.setEndPageNumber(1);
exportOptions.setFormatOptions(xlexpopts);
exportControl.setExportOptions(exportOptions);
exportControl.setExportAsAttachment(true);
exportControl.processHttpRequest(request, response, application, null);
exportControl.dispose();
%>