Contents

 

Upgrading Servoy for new iReport Versions

So you have the latest iReport version and now you find there is no output from the smart client but everything seems ok in the developer?

Well, that means in all likelihood that the version of iText.jar used by the iReport or the Jasper Reports engine is different than the one in the Servoy plugins directory. (Note that the itext.jar file is in the /plugins/servoy_jasperreports folder but if you download the 3.0.0.a1 zip file it seems to be not included!).

But where is this iText.jar that is needed? The best place to find it is in the iReports installation directory tree.

(Note: in the following I have changed all file separator characters to forward-slash from back slash so they don't disappear on rendering this html.)

As an example on my system I have installed iReports 3.5.2 in my E:/ directory and you look for the external jar files used by iReport in the "ext" directory but buried a little:

E:/iReport3.5/iReport-nb-3.5.2/ireport/modules/ext

Here is a screen shot of the folder structure showing the specific iText jar used:

itext location

 

Copy this iText-2.1.0.jar (or whatever the version number may be) to the Servoy installation directory where the plugins are installed: in my case:
C:/Program FilesServoy/plugins/servoy_jasperreports

Tip: ensure you delete or rename the old iText.jar to something that does not end in .jar (e.g. iText.jar.ORIG) and then edit the servoy_jasperreports.jar.jnlp file to reference this new iText-2.1.0.jar rather than just the iText.jar. I prefer to know which version of the jar file is being used rather than hiding it.

Now you have to check where ever iText.jar is duplicated in the plugins sub-folders and replace it or you will also get weird behaviour. For instance in my case using 3.5.9 the /plugins/pdf_output folder also contains an old version of iText.jar (Why is this duplicated  and not just a single copy to replace? Please ask Servoy!) If you replace this then you will also have to go and edit the pdf_output.jar.jnlp file as well to refer to the new verison of the iText file you just copied into the /plugins/pdf_output folder.

Tip: Never have more than one jar file (a file ending in ."jar") that contains iText in the same folder that will also cause confusion!

But wait - that is not enough!

Now that you have the editor opened for the servoy_jasperreports.jar.jnlp file you should change the jasperreports.jar to use as well. In fact it is wise to check each jar file in the jnlp to see if it needs an upgrade to that version used in the iReport ext folder. For instance is the jdt-compiler.jar the same version as that used by iReports? How about the common-beanutils.jar or the commons-digester.jar or the commons-javaflow.jar? So you get the idea - check them all and replace any that are suspect old.

But wait - that may not be enough!

(will this ever stop?)
With the advent of servoy_jasperreports-3.0.0a1.jar (the first alpha of the plugin) there are other issues that arise in the jnlp.
The following information is still in transition so it might change over time.

The export to an Excel (xls) file type also requires that the jar file used by iReport be also downloaded to the smart client in addition to all the jar files mentioned in the jnlp in the previous paragraph. iReport used the "poi" utility from the "jakarta" project. If you follow the threads in the google code area (google code) you will see the efforts of others to track this down.

For you to upgrade there is more work! There is a /plugins/jakarta-poi folder to upgrade the jar file there to the one used by iReport. In my case the correct file was found here:

E:/iReport3.5/iReport-nb-3.5.2/ireport/modules/ext/poi-3.2-FINAL-20081019.jar

The actual version of the poi jar file may be different in the verison of iReport that you have installed.

Copy this poi jar file to the plugin folder, in my case:

C:/Program Files/Servoy/plugins/jakarta-poi

If you used the full jar file name you now have to go and change the jnlp file associated with this jar file as well as add it to the download list for servoy_jasperreport.jar.jnlp.

One last jar file is also required (at the time of this writing it is the last one but maybe there will be more...).
It was found for the 3.0.0.a1 version that the commons-collections.jar also needed to be downloaded to the smart client for the servoy-jasperreports.jar

So here is my jnlp file for my version of the plugin for 3.0.0a1 in case anyone wants to test for us:

Tip: This has been tested for use with Servoy 3.5.x (up to version 10).  Therefore the requirements for the Servoy 4.x is not needed UNLESS you want to use foundset as data source.


<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="%%serverURL%%" href="/servoy-client/plugins/servoy_jasperreports_pitc.jar.jnlp">
    <information>
        <title>Servoy Client Plugins</title>
        <vendor>Servoy and PITC</vendor>
    </information>
    <resources>
        <jar href="/plugins/servoy_jasperreports_pitc.jar" download="eager"/>
        <jar href="/plugins/servoy_jasperreports_pitc/jasperreports-3.5.2.jar" download="eager"/>
        <jar href="/lib/commons-collections.jar" download="lazy" part="commons-collections" version="%%version%%"/>
            <package name="org.apache.commons.collections.*" part="commons-collections" recursive="true"/>
        <jar href="/plugins/servoy_jasperreports_pitc/commons-digester-1.7.jar" download="lazy" part="commons-digester" version="1.7"/>
            <package name="org.apache.commons.digester.*" part="commons-digester" recursive="true"/>
        <jar href="/plugins/servoy_jasperreports_pitc/iText-2.1.0.jar" download="eager"/>
        <jar href="/plugins/jakarta-poi/poi-3.2-FINAL-20081019.jar" download="lazy"/>
        <jar href="/plugins/jxl-2.6.jar" download="lazy"/>
        <jar href="/plugins/servoy_jasperreports_pitc/commons-beanutils-1.8.0.jar" download="lazy"/>
    </resources>
    <component-desc></component-desc>
</jnlp>


 If that does not faze you then please check out what I did and tell me where to improve!