Friday, August 9, 2013

SAP Crystal Reports with ReportServer

In version 2.1 we added experimental support for SAP Crystal Reports which can now be used alongside Jasper and Birt for generating graphical reports with ReportServer. In this blog post we want to show you how to get started with Crystal.

SAP Crystal Reports is the first proprietary reporting component supported by ReportServer and thus, we are not allowed to ship the necessary jars with the open source ReportServer release. If you do have a proper Crystal Reports license you are, however, good to go.

In order to use Crystal Reports with ReportServer you must first install the SAP Crystal Reports for Java runtime components (short, the Java Reporting Component (JRC)). You'll find these, for example, on the following SAP download site.  Here, look for Runtime Libraries and download the there located archive (around 45mb). Unzip the archive and locate the lib directory. This includes all the additional libraries you have to install to get going with Crystal Reports. The following jars are needed:
  • com.azalea.ufl.barcode.1.0.jar
  • CrystalCommon2.jar
  • CrystalReportsRuntime.jar
  • cvom.jar
  • DatabaseConnectors.jar
  • icu4j.jar
  • jai_imageio.jar
  • JDBInterface.jar
  • jrcerom.jar
  • keycodeDecoder.jar
  • logging.jar
  • pfjgraphics.jar
  • QueryBuilder.jar
  • webreporting-jsf.jar
  • webreporting.jar
  • XMLConnector.jar
  • xpp3.jar
That is, all jars except the commons-*.jar and log4j.jar. Note that these should not be included as ReportServer already ships with newer versions of these components. Copy the above mentioned jars to the ReportServer WEB-INF/lib directory and start ReportServer.

Next, we need a demo report. Reports for Crystal Reports come in the .rpt file format. Either use your Crystal Reports designer to patch up a small demo report or simply download a demo report (click on View Document for the download to start). If you downloaded the demo report, unzip the archive and you'll find a report file called jrc_view_report.rpt.

Log into ReportServer and go to the report management area in the administration module. Create a new "Crystal Report" (right click on a folder) fill in some dummy properties and select the jrc_view_report.rpt file for upload.


Note that in the current version the datasource field is ignored by ReportServer. That is, the report is executed with the datasource that is configured within the .rpt file (similar to Birt reports, if the datasource field is left blank).

If you submit the data, you can now execute the report by double clicking the icon in the tree. Et voilĂ , your first Crystal Report with ReportServer.


You can now work with this report just as with any other report in ReportServer. That is, export it to various formats, schedule it, include it in TeamSpaces etc.

We are looking forward to hearing your thoughts on the integration of SAP Crystal Reports in ReportServer, especially in terms of what features you are missing.

4 comments:

  1. after following this instructions I am getting this error, any help is appreciated:

    Fehler: An error occured during report execution.
    The report could not be executed: java.lang.ClassNotFoundException: com.crystaldecisions.sdk.occa.report.application.ReportClientDocument
    Im Falle eines nicht nachvollziehbaren Fehlers kontaktieren Sie bitte einen Administrator.
    Details:
    net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: java.lang.ClassNotFoundException: com.crystaldecisions.sdk.occa.report.application.ReportClientDocument at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:218) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exeucteReport(ReportExportServlet.java:467) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReport(ReportExportServlet.java:358) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportViaSession(ReportExportServlet.java:293) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doGet(ReportExportServlet.java:155) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$f7131406.CGLIB$doGet$2() at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$f7131406$$FastClassByGuice$$9394d8fd.invoke() at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72) at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$f7131406.doGet() at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$f7131406.CGLIB$service$14() at

    ReplyDelete
  2. The error indicates that the CrystalReportsRuntime.jar, (which contains the ReportClientDocument class) is missing or not accessible.
    Verify that you indeed copied all the files listed above to the correct location and that permissions are set so that the tomcat user can access them.
    If this doesn't help, please create a topic in our forum at forum.reportserver.net

    ReplyDelete
  3. I did copy this jar and found this class there:

    C:\Program Files\reportserver\tomcat\webapps\reportserver\WEB-INF\lib\CrystalReportsRuntime.jar\com\crystaldecisions\sdk\occa\report\application\

    Now I will try to create a topic in the forum

    ReplyDelete
  4. Thank you for sharing. Now I'm developing a barcode generator, which require to support creating barcode in Crystal Reports. I've learned something about SAP Crystal Reports from your article, it's quite excellent. So I hope I can learn more from your experience, can you give me any suggestions about creating barcode in Crystal Reports? Any help will be appreciated.

    ReplyDelete