| Author |
jsp crystal reports xls
|
Hugo de la Mora
Greenhorn
Joined: Jun 29, 2002
Posts: 14
|
|
|
Hi, does anyone knows how to export data to Excel from JSP using Crystal Reports, thx in advance.
|
 |
Hugo de la Mora
Greenhorn
Joined: Jun 29, 2002
Posts: 14
|
|
here is my code <%@ page import="com.crystaldecisions.report.web.viewer.*, com.crystaldecisions.reports.reportengineinterface.*, com.crystaldecisions.sdk.occa.report.data.*, com.crystaldecisions.sdk.occa.report.reportsource.*, com.crystaldecisions.sdk.occa.report.exportoptions.*" %> <% String report = "test3.rpt"; IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory(); IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(report, request.getLocale()); try{ ReportExportControl expControl = new ReportExportControl(); ExportOptions exOpts = new ExportOptions(); //exOpts.setExportFormatType(ReportExportFormat.RTF); //exOpts.setExportFormatType(ReportExportFormat.recordToMSExcel); exOpts.setExportFormatType(ReportExportFormat.MSExcel); //RTFWordExportFormatOptions options = new RTFWordExportFormatOptions(); //DataOnlyExcelExportFormatOptions options=new DataOnlyExcelExportFormatOptions(); ExcelExportFormatOptions options = new ExcelExportFormatOptions(); options.setStartPageNumber(1); options.setEndPageNumber(3); exOpts.setFormatOptions(options); expControl.setExportOptions(exOpts); expControl.setReportSource(reportSource); expControl.setExportAsAttachment(true); expControl.setOwnPage(true); expControl.refresh(); //expControl.processHttpRequest(request, response, config.getServletContext(),out); expControl.processHttpRequest(request, response,getServletConfig().getServletContext(), null); expControl.dispose(); }catch(Exception e){out.println(e);} i'm getting this error Error exporterName is empty what can i do?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
i'm getting this error Error exporterName is empty
That is clearly an error being thrown by the code you are calling. You'll need to investigate in what way you are calling it incorrectly. Since this really has nothing to do with JSP, I've moved it along to the Other Java Products forum.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Chandra Mohan
Ranch Hand
Joined: Oct 06, 2003
Posts: 62
|
|
Hi, I am facing the same problem. I added this but with no effect. Any clue? Thanks in advance, JPEReportSourceFactory jrsf = new JPEReportSourceFactory(); ExportOptions exOpts = new ExportOptions(); exOpts.setExportFormatType(ReportExportFormat.recordToMSExcel); //ExcelExportFormatOptions options= new ExcelExportFormatOptions(); DataOnlyExcelExportFormatOptions options=new DataOnlyExcelExportFormatOptions(); options.setMaintainRelativeObjectPosition(true); options.setExportImages(true); options.setExportObjectFormatting(true); options.setMaintainColumnAlignment(true); options.setExportObjectFormatting(true); options.setExportPageHeaderAndFooter(true); options.setUseWorksheetFunctionsForSummaries(true); options.setBaseAreaType(AreaSectionKind.detail); exOpts.setFormatOptions(options); ReportExportControl expViewer = new ReportExportControl(); expViewer.setName("Excel1.xls"); expViewer.setEnableParameterPrompt(true); expViewer.setExportOptions(exOpts); expViewer.setReportSource(jrsf.createReportSource("Report.rpt",request.getLocale())); expViewer.setOwnPage(true); expViewer.setOwnForm(true); expViewer.processHttpRequest(request, response, config.getServletContext(),out); expViewer.dispose();
|
Thanks and Regards
Chandra Mohan
|
 |
 |
|
|
subject: jsp crystal reports xls
|
|
|