Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exporting Crystal reports to Excel

 
Chandra Mohan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing a problem in exporting the crystal reports to an excel file. i am using CR11. It is saying that the exporterName is not defined. I added setName 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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic