How to use i-net Clear-Reports or i-net PDFC as library in an application server?

There are two modes how you can use i-net Clear-Reports and i-net PDFC:

  • The plugin mode (default)
  • The library mode

The default mode is the plugin mode. Any features can be added using plugins (i-net Clear Reports - Help). The plugin mode provides all features of the products, including the web interface. With this mode, you can use the API and the web interface with the same servlet.
To use the API in the plugin mode, it will be necessary to implement your own plugin. The i-net Clear Reports SDK includes samples plugins.

For historical reasons, you can use i-net Clear-Reports and i-net PDFC also as a simple library (library mode). In this library mode, you can use the API directly from your application server logic. But you can not use the web interface of the application servlet.
For new developments, we recommended using the plugin mode. But there is currently no plan to stop supporting the library mode in the future.

How does it work?

Both modes can work with plugins. However, the library mode can also initialize the reporting plugin from an extracted plugin which was added directly to the class path. The difference is the different start point.

  • For the i-net Clear Reports library mode, the start point must be com.inet.report.Engine.
  • For the i-net PDFC library mode, the start point is com.inet.pdfc.PDFComparer.
  • For the plugin mode, the start point is com.inet.http.PluginDispatcherServlet.

Steps to use the library mode in i-net Clear Reports:

  • The start point is the referenced WAR file, which you can download from our website
  • Open the reporting.zip plugin and extract the file reporting.jar. Also extract jcommon.jar and jfreechartCC.jar if you want to use charts in your reports
  • Remove the reporting.zip from the plugins directory. It will be fatal if there are two instances of the same API
  • Remove all not needed plugins. The most plugins add a web GUI component which not work in the library mode. Removing unused plugins can improve the performance
  • Remove everything from the web.xml. If you want to render reports via HTTP, then you can add com.inet.report.servlets.ReportPluginServlet to the web.xml
  • Add the code snippet: new com.inet.report.Engine( EXPORT_PDF ) in your init method to trigger the initializing of i-net Clear-Reports

Adding extracted Plugins
Additional plugins can also be added without being packaged first when their program code is available from a library path. You can use the API ServerPluginManager.getInstance().addExtractedPlugin(className) to register the plugin. The class name that you have to use can be derived from the entrypoint entry in the plugin.properties-file.

Note: If your extracted plugins have dependencies to non-extracted plugins, you have to extract and register them as well.

Errors and causes

  • java.lang.NoClassDefFoundError - You have two instances of the reporting API. Remove the reporting.zip from the plugins directory

  • Licence for another application: i-net Clear-Reports - The reporting.zip plugin was removed, but the first initializing does not occur via new com.inet.report.Engine( EXPORT_PDF ). Check the web.xml. Did you remove any reference to com.inet.http.PluginDispatcherServlet?