Skip to Content

Excel Export with Crystal Reports for Eclipse 2.0 Service Pack 1

Quick blog this time.

Crystal Reports for Eclipse 2.0 Service Pack 1 was just released!

It now supports full Microsoft Excel export – not just data-only, but the report, including images, in Excel format!

Java Server Pages code page sample:

bq. java_crj12_web_export_excel.jsp – CR Java SDK to export to Excel<br /><textarea cols=”75″ rows=”10″><%@ page import=”,

String reportPath;

ReportClientDocument reportClientDocument;

ByteArrayInputStream byteArrayInputStream;

byte[] byteArray;

int bytesRead;

reportPath = request.getParameter(“report_path”);


  • Instantiate ReportClientDocument and specify the Java Print Engine as the report processor.

  • Open a rpt file and export to Excel.  Stream Excel back to web browser.


reportClientDocument = new ReportClientDocument();

reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);, OpenReportOptions._openAsReadOnly);

byteArrayInputStream = (ByteArrayInputStream) reportClientDocument



response.setHeader(“Content-disposition”, “inline;filename=crreport.xls”);


byteArray = new byte[1024];

while((bytesRead = != -1) {

     response.getOutputStream().write(byteArray, 0, bytesRead);     






Have Fun!

1 Comment
You must be Logged on to comment or reply to a post.
  • 1) Boxes and lines doesn’t show in my exported Excel
    2) Quirk in pagination: I have a report that I exported to PDF (2 pages) and to Excel. When I exported it to Excel, the page footer for the first page didn’t appear, only for the second page and no page break was inserted between the first page and the second page. Should be okay, since it seems that it treats the whole report as a single page. But the page footer that appeared for the 2nd page displays “Page 2 of 2” and there lies the problem.