Showing posts with label JasperReports. Show all posts
Showing posts with label JasperReports. Show all posts

Tuesday, April 15, 2014

JasperReportsIntegration - Full path requirement and workaround

I have just posted an answer to a question that seems like a bug in the JasperReportsIntegration toolkit, that you have to use absolute paths for referencing images or subreports, which is typically a bad thing.

Don't know exactly why it doesn't work, but there is a workaround for that: http://www.opal-consulting.de/site/jasperreportsintegration-full-path-requirement-and-workaround/

Hope that helps,
~Dietmar.

Thursday, November 21, 2013

Upgrading the JasperReports libraries to 5.2.0

Would you like to upgrade your existing JasperReportsIntegration with the 5.2.0 libraries of JasperReports?

As of now this already seems to be not the most current version, JasperReports has already moved on to 5.5.0. But since I have already created the 5.2.0 package a while ago, I might just post the instructions here. The 5.5.0 version will follow.

Here you go ...

This is an updated version of the original instructions found here: http://daust.blogspot.de/2013/01/upgrading-jasperreports-libraries-to-501.html

Step 1: Download the libary files for 5.2.0


You can download the files here:


 

Step 2: Shutdown the Apache Tomcat J2EE server

 

Step 3:  Remove the existing JasperReportsLibraries from your existing installation


Typically, after you have installed your previous version of the JasperReportsIntegration toolkit on your Apache Tomcat J2EE server, the files will be located in the directory $CATALINA_HOME/webapps/JasperReportsIntegration/WEB-INF/lib, for example version 4.7.0 of JasperReports, where $CATALINA_HOME represents the path to your installation of Tomcat.

Then you would have to remove these libraries first. In this directory you should find two files for removal: _jasper-reports-delete-libs-4.7.0.sh and _jasper-reports-delete-libs-4.7.0.cmd, for *nix or Windows respectively. For *nix systems you would have to make it executable, though, e.g.: chmod u+x _jasper-reports-delete-libs-4.7.0.sh . Then you can call it and it will remove all files for version 4.7.0. But it will NOT remove the file for the JasperReportsIntegration and all other libraries which YOU might have placed there deliberately.

You can always find the required removal scripts here: http://www.opal-consulting.de/downloads/free_tools/JasperReportsLibraries/ .

Whenever I release another package, the removal scripts for that package will be shipped as well.

Step 4: Install the new 5.2.0 libraries


Now you can just copy the new libraries from JasperReportsLibraries-5.2.0.zip into $CATALINA_HOME/webapps/JasperReportsIntegration/WEB-INF/lib.

 

Step 5: Start the Apache Tomcat J2EE server again


Now you system should be upgraded to the most current JasperReports 5.2.0 !

Just drop me a note when you need updated libraries for a later JasperReports version, etc. I have scripts in place to create a new package of the libraries.

Here you can find the notes from my upgrade (4.5.0 => 4.8.0) on Linux to illustrate the process, I hope it makes sense:

**
** download the libraries from:
**  http://www.opal-consulting.de/downloads/free_tools/JasperReportsLibraries/4.8.0/JasperReportsLibraries-4.8.0.zip
** to /home/jasper/JasperReportsLibraries

cd /home/jasper
mkdir JasperReportsLibraries

** unzip them
cd JasperReportsLibraries
unzip JasperReportsLibraries-4.8.0.zip -d JasperReportsLibraries-4.8.0

** stop tomcat server
/home/jasper/tomcat/bin/shutdown.sh

** remove libraries of current jasper reports release
cd /home/jasper/tomcat/webapps/JasperReportsIntegration/WEB-INF/lib
chmod +x _jasper-reports-delete-libs-4.5.0.sh
dos2unix _jasper-reports-delete-libs-4.5.0.sh

./_jasper-reports-delete-libs-4.5.0.sh

** copy libraries of the new release to the WEB-INF/lib directory
cp /home/jasper/JasperReportsLibraries/JasperReportsLibraries-4.8.0/* /home/jasper/tomcat/webapps/JasperReportsIntegration/WEB-INF/lib

** restart tomcat
/home/jasper/tomcat/bin/startup.sh


Cheers,
~Dietmar.

Thursday, January 10, 2013

Upgrading the JasperReports libraries to 5.0.1

Would you like to upgrade your existing JasperReportsIntegration with the latest 5.0.1 libraries of JasperReports?

Here you go ...

Step 1: Download the files for 5.0.1


You can download the files here:


 

Step 2: Shutdown the Apache Tomcat J2EE server

 

Step 3:  Remove the existing JasperReportsLibraries from your existing installation


Typically, after you have installed your previous version of the JasperReportsIntegration toolkit on your Apache Tomcat J2EE server, the files will be located in the directory $CATALINA_HOME/webapps/JasperReportsIntegration/WEB-INF/lib, for example version 4.7.0 of JasperReports, where $CATALINA_HOME represents the path to your installation of Tomcat.

Then you would have to remove these libraries first. In this directory you should find two files for removal: _jasper-reports-delete-libs-4.7.0.sh and _jasper-reports-delete-libs-4.7.0.cmd, for *nix or Windows respectively. For *nix systems you would have to make it executable, though, e.g.: chmod u+x _jasper-reports-delete-libs-4.7.0.sh . Then you can call it and it will remove all files for version 4.7.0. But it will NOT remove the file for the JasperReportsIntegration and all other libraries which YOU might have placed there deliberately.

You can always find the required removal scripts here: http://www.opal-consulting.de/downloads/free_tools/JasperReportsLibraries/ . 

 

Step 4: Install the new 5.0.1 libraries


Now you can just copy the new libraries from JasperReportsLibraries-5.0.1.zip into $CATALINA_HOME/webapps/JasperReportsIntegration/WEB-INF/lib.

 

Step 5: Start the Apache Tomcat J2EE server again


Now you system should be upgraded to the most current JasperReports 5.0.1 !

Just drop me a note when you need updated libraries for 5.0.2, 5.0.3, ... 6.0.0, etc. I have scripts in place to create a new package of the libraries. 

Here you can find the notes from my last upgrade (4.5.0 => 4.8.0), I hope it makes sense:

**
** download the libraries from:
**  http://www.opal-consulting.de/downloads/free_tools/JasperReportsLibraries/4.8.0/JasperReportsLibraries-4.8.0.zip
** to /home/jasper/JasperReportsLibraries

cd /home/jasper
mkdir JasperReportsLibraries

** unzip them
cd JasperReportsLibraries
unzip JasperReportsLibraries-4.8.0.zip -d JasperReportsLibraries-4.8.0

** stop tomcat server
/home/jasper/tomcat/bin/shutdown.sh

** remove libraries of current jasper reports release
cd /home/jasper/tomcat/webapps/JasperReportsIntegration/WEB-INF/lib
chmod +x _jasper-reports-delete-libs-4.5.0.sh
dos2unix _jasper-reports-delete-libs-4.5.0.sh

./_jasper-reports-delete-libs-4.5.0.sh

** copy libraries of the new release to the WEB-INF/lib directory
cp /home/jasper/JasperReportsLibraries/JasperReportsLibraries-4.8.0/* /home/jasper/tomcat/webapps/JasperReportsIntegration/WEB-INF/lib

** restart tomcat
/home/jasper/tomcat/bin/startup.sh


Cheers,
~Dietmar.

Monday, August 13, 2012

JasperReportsIntegration: Passing multiple parameters to the report

With the JasperReportsIntegration kit I provide a mechanism to call JasperReports reports from an APEX application.

The reports are stored locally in the filesystem accessible to the j2ee container running the JasperReportsIntegration j2ee application. This application will connect to the desired Oracle schema using connection information deployed in the J2EE container.

This j2ee application provides an url interface to calling the desired report against a desired data source.

So how can we pass parameters to our report, e.g. for producing a report for a specific customer or order number?

Let's consider my test report for that purpose (test.jrxml). The test report will list the user objects installed in the Oracle schema we connect to as well as produce some header information about the selected report locale. You can even pass three parameters to the report called parameter1, parameter2 and parameter3.

So, how can we pass the parameters to the report?

First of all we need to specifiy the parameters in the report itself. I have added the three parameters to the parameter list:


Currently all parameters (which we want to call from the JasperReportsIntegration kit) have to be specified as java.lang.String, no other data types are allowed. I might add that as a new feature in a later release. But for now only strings are allowed:


We assume that we have an APEX page with two page items, P1_FILTER_OBJECT_NAME and P1_FILTER_OBJECT_TYPE.

In order to pass these two parameters to the test report using the pl/sql interface XLIB_JASPERREPORTS, you would do the following:
declare 
  l_additional_parameters varchar2(32767);
begin
  -- set the url for the j2ee application
  -- better retrieve that from a configuration table
  xlib_jasperreports.set_report_url('http://localhost:8090/JasperReportsIntegration/report');

  -- construct addional parameter list
  l_additional_parameters := 'parameter1=' || apex_util.url_encode(:p1_filter_object_name);
  l_additional_parameters := l_additional_parameters || '&parameter2=' || apex_util.url_encode(:p1_filter_object_type);

  -- call the report and pass parameters
  xlib_jasperreports.show_report (p_rep_name => 'test',
                                  p_rep_format => xlib_jasperreports.c_rep_format_pdf,
                                  p_data_source => 'default',
                                  p_additional_params => l_additional_parameters);

  -- stop rendering of the current APEX page
  apex_application.g_unrecoverable_error := true;
end;

Why do we use apex_util.url_encode? This is required since we essentially pass the parameters via an url to the j2ee application. 

When the report is executed, we get the following result (assuming P1_FILTER_OBJECT_NAME=APEX$ and P1_FILTER_OBJECT_TYPE=TRIGGER):
 
Using the test report this will just display the passed parameters. If you want to filter the user objects using the parameters you could modify your query to:

This will filter the result either bei object_name or object_type (in the example I filtered by the object type TRIGGER):

Hope that helps,
~Dietmar.

Monday, August 06, 2012

JasperReportsIntegration 2.0.0 - Beta Test

Hi guys,

I am pleased to announce the beginning of the beta test for the upcoming release 2.0.0 of the JasperReportsIntegration kit.

I welcome you all to participate in the beta test, you might even have the chance to get some extra features in or at put your wish at least on the roadmap.

This release focuses a lot on ease of use, stability and support of different application servers. But there are interesting new features as well:

Support for JasperReports 4.7.0

I have included the latest libraries from JasperReports to stay up to date with the current JasperReports release.

Included Oracle JDBC connection pool

In addition to the JNDI configuration of the data sources you can now use a plain configuration file to use the Oracle JDBC connection pool directly. It is included in the J2EE application. Thus the configuration will be identical on all J2EE servers ... and it is really easy to use :). 





Support for the major application servers

I have already tested on Jetty, Tomcat and Weblogic. Here I will need your support to test against other J2EE servers as well!

Fine grained logging and better error messages

Iam using log4j as the logging framework now with nicely written logfiles and support for different log levels. Also, everything is checked, no more null pointer exceptions, you should always get a really precise error message. 

Reports can be deployed anywhere on the server

You can manipulate the search path for the report files using an environment variable on the operating system or a setting in the application server configuration (e.g. web.xml). This way you can easily upgrade the integration kit, your reports and the configuration files will not be removed by an undeploy/redeploy of the application. 

Storing files on the application server directly

Storing files on the application server directly (just as Oracle Reports did, destype=FILE). Developers from an Oracle Reports background will like this one. You can enable this feature and provide a filename on the server on which to save a copy of the generated report. 

Directly sending output to a network printer

Also, this is a feature well known from Oracle Reports. Just specify a printer (which is locally known to the application server) and send the output directly to it. You can specify the media (size or tray), the number of copies and whether the output shall be sorted (collate).

You can call the PrinterDiagnostics page to discover the locally installed printer and their settings: 





Major upgrade of the test application

The new version will check everything that is required and give specific suggestions on how to fix it. 

If everything is setup correctly, all tests will pass. 


If anything goes wrong, you will get detailed error messages and precise instructions on how to fix it: 





Quick Start

Personally, I love this one. Especially to get the beginners started I have included the Jetty server in the download. You can start the J2EE application just by clicking on a shell script, can it get any easier?
Even for myself it is nice to have the test report up and running in two minutes :) 

The documentation can be found here. To go to the download directly, click here

I have created another forum for the beta test, so please post all questions, issues, findings here: http://www.opal-consulting.de/forums/viewforum.php?f=10 .

Hope you enjoy it :). 

Cheers, 
~Dietmar. 

Wednesday, August 01, 2012

JasperReports 4.7.0 released

JasperReports 4.7.0 was released a few weeks ago. The new release of the iReport designer is not yet announced on the homepage, but you can download the new files already: http://sourceforge.net/projects/ireport/files/iReport/

I will update the integration kit in a few days. This time it will be released with a major update and lots of new features:

  • Included Oracle JDBC connection pool: in addition to the JNDI configuration of the data sources you can now use a plain configuration file to use the Oracle JDBC connection pool directly. It is included in the J2EE application. Thus the configuration will be identical on all J2EE servers. 
  • I will test on the major J2EE servers and make sure it runs everywhere. Might need support from the community to test everything. 
  • Fine grained logging and better error messages: I am using log4j as the logging framework now with nicely written logfiles and different log levels. 
  • Reports can be deployed anywhere on the server: You can manipulate the search path for the report files using an environment variable on the operating system or a setting in the application server configuration (e.g. web.xml). This way you can easily upgrade the integration kit, your reports and configuration files will not be removed by an undeploy/redeploy of the application. 
  • Storing files on the application server directly (just as Oracle Reports did, destype=FILE).
  • Sending reports directly to a network printer
  • Adding security features, especially a token-based validation function for each data source. Using this technique, you can create a token in the database, pass it to the Integration kit and have it validated back in the database. This way you can share a single Tomcat instance among different applications. 
The main focus for this upcoming release was ease of deployment and troubleshooting.

Cheers, 
~Dietmar. 





Thursday, July 12, 2012

JasperReports Online Training-free modules

JasperSoft provides online training for JasperReports and the iReport designer. You can find it here: https://www.jaspersoft.com/bi-training-center

Some of the content is free, some of the content is being charged for with a monthly subscription around $200 per month.

One free nugget you should propably have a look at is the configuration of the iReport Table Component.

If that link won't work over time any more, this is how I got there: Home > Services > Training > Online Learning Portal > Enabling Report Interactivity with the Table Component.

Why is that important? In order to have an additional detail query in your report you would have to create a subreport to achieve that. Using subreports requires you to use additional files for each detail query.

Using the Table Component is an alternative approach to that being able to use a subquery within the current report definition - no longer having to use a separate file.

Although this feature is around for a long time (I guess for a year or two) it is not well documented. So you should definitely have a look.

Cheers,
Dietmar.

Update 12.07.2012: Here is another link: https://www.jaspersoft.com/blog-entry/jasperreports-interactivity-the-table-component

I have also updated the link for the configuration of the iReport Table Component, it was broken.
 


Sunday, July 08, 2012

JasperReportsIntegration 1.3.0.2 available - now supporting JasperReports 4.6.0

Hi guys,

I have updated the JasperReportsIntegration kit. The new libraries 4.6.0 of JasperReports are now included.

The integration kit itself has not changed. Thus you can simply update the JasperReports libraries to version 4.6.0. This process is explained in the FAQ.

You can find all details, FAQ and downloads here: http://www.opal-consulting.de/tools .

Hopefully I will publish another new version soon, I would like to include an Oracle connection pool in order to simplify the configuration of the data sources which is completely different on all J2EE servers :(. I did this for performance reasons but it didn't turn out to be such a good choice.

Cheers,
Dietmar.

Thursday, May 31, 2012

JasperReportsIntegration howto article republished

Hi guys,

this article has been published already two years ago in the ODTUG magazine, but it should still work the same way:

http://www.opal-consulting.de/downloads/free_tools/JasperReportsIntegration/Opal-Consulting-JasperReportsIntegration.pdf

If you have any issues, please let me know.

Cheers,
Dietmar.


Saturday, May 26, 2012

Join me at the DOAG Development Conference in Bonn (14.06.2012)

Typically, the DOAG e.V. is hosting its yearly conference in Nuremberg. The DOAG is the German Oracle User Group and the DOAG conference is the premier event in Germany focusing on everything Oracle. There you will find all kinds of presentations for developers, DBAs, management and so forth.

For the first time though, the DOAG will host a smaller conference in Bonn, solely for Oracle developers. The conference covers the following four tracks: "PL/SQL and APEX", "Java and Open Source", "Forms, Reports, ADF, BI-Publisher", "BPM and Softwarearchitecture".
Find the complete conference program as PDF online.

You can get more information on the conference website, you can also register online. 

If you like you can join me there, I will be presenting on "from Oracle Reports to Jasper Reports": 
Many customers are moving away from Oracle Forms to other alternatives. Oracle APEX is an especially interesting option because it leverages existing Oracle database skills (SQL and PL/SQL) nicely. But what about your existing Oracle Reports? This presentation will cover the open source solution, JasperReports, as a viable alternative. The session will cover the typical use cases and design patterns used when building reports in Oracle Reports and how to implement them using JasperReports. You will learn how to get started with JasperReports and how to integrate that functionality into your APEX applications.
Cheers,
~Dietmar.

Saturday, May 05, 2012

JasperReportsIntegration - new support forums available

I have just published my new support forums for my JasperReportsIntegration kit (http://www.opal-consulting.de/tools).

You can find it here: www.opal-consulting.de/forums/

Please post all of your questions about JasperReports and the integration here, you can also place your enhancement requests there.

Cheers,
Dietmar.

Oracle Reports to JasperReports-I need your questions

Hi guys,

at the next ODTUG conference (http://kscope12.com/) I will be speaking about about moving your existing reports written in Oracle Reports to JasperReports.

Since many people are moving away from Oracle Forms, Oracle APEX seems to be a natural choice, since you can leverage your existing PL/Skills as well as your existing PL/SQL business logic nicely.

But what about your reporting needs? What alternative will you choose for your existing reports written in Oracle Reports?

What questions would be interesting for making a choice and migrating your reports?

Here are a few samples:
  • are there any license costs involved?
  • are all features that we need, supported? What are these features, that YOU need?
  • are there any limits, e.g. the size of the files that can be generated?
  • how can JasperReports integrated into my APEX application and secured?
  • is it performant?
  • is there a batch interface like rwcli? 
What are your questions?

Cheers,
Dietmar.

Thursday, April 26, 2012

Jasper Reports Ultimate Guide now available for free

Hi guys,

many of you might be using Jasper Reports for designing your reports with Oracle APEX. The documentation provided by Jasper Soft had to be paid for.

I have just noticed that the Ultimate Guide is now available for free! So check it out: https://www.jaspersoft.com/store/jasperreports-ultimate-guide-documentation

It is not based on the latest version of Jasper Reports but nevertheless useful.

Cheers,
Dietmar.

Thursday, March 08, 2012

JasperReportsIntegration 1.3.0.1 available

I have just released a bugfix for version 1.3.0, it is version 1.3.0.1.
The new version and the updated documentation is available here: https://www.opal-consulting.de/apex/f?p=20090928:4:0:::::
Dietmar. 



Sunday, January 02, 2011

Issue with JasperReportsIntegration and the XML DB Listener

Hi guys,

I have helped somebody troubleshoot an issue with my JasperReportsIntegration kit. Although he had followed the instructions correctly, the report wouldn't show in the application.

It worked correctly when calling the j2ee application in the tomcat directly, but not when calling the report using the plsql interface xlib_jasperreports (which calls the j2ee server using utl_http)

The issue is related to the XML DB listener (also the primary http listener of Oracle XE) not supporting the http 1.1 standard. Since the XML DB listener only supports the 1.0 standard, the http parameter chunked transfer encoding is not working properly. 

When calling the report through my JasperReportsIntegration toolkit you would either see an empty report or nothing at all.

See this thread for more details and your options: http://forums.oracle.com/forums/thread.jspa?messageID=4563910#4563910

Also, this problem will not crop up when you use a plain Apache as a proxy to your XE installation.

Cheers,
Dietmar.

Saturday, September 04, 2010

Jasper Reports Integration v1.1.0.0

I have just published version 1.1.0.0 of my Jasper Reports Integration package for integrating Jasper Reports into your Oracle APEX applications. There is no dependency on a specific APEX version nor on the database version.

You can find more information here: http://www.opal-consulting.de/tools

What can you do with it? Creating high-fidelity print ready reports in PDF, RTF, XLS and other formats using a really good report designer (iReport). And the best about it ... it is for free !

What are the major changes?
  • Upgrade of the libraries to Jasper Reports 3.7.4. Before, only reports created with iReport version 3.6.0 and below could have been run with this integration kit. Now the most up-to-date version of the JasperReports libraries are included. 
  • Instructions for using the integration on Oracle 11.x was added. In order to use http callouts one has to configure the access control lists (ACL) for accessing external network resources. 
Please let me know if anything is not working or when a new version of Jasper Reports is coming out and you need the updated libraries for running the reports.

Cheers and enjoy,
~Dietmar.

Thursday, January 14, 2010

Jasper Reports Integration - beta release v0.8.0.0

First the good news: I have finally wrapped up the Jasper Reports Integration package and made it available for download.

It is in beta quality and needs some more testing (of the code and documentation) before it should be used in production. Once it hits the first production release, the interface packages should remain stable. Until then they might change with the later beta releases.

Everybody who wants to join the beta program is more than welcome! Any feedback is welcome.

You can get all the files, infos about the architecture and the installation guides here.

Then, I really have to apologize for taking so long (I had promised to release it much earlier) and not responding to many of the emails I have received. I am really sorry for that but my life has gone haywire in the last year - and I am still recovering from that. 

Update on 04.09.2010: Version 1.1.0.0 is now available: http://daust.blogspot.com/2010/09/jasper-reports-integration-v1100.html

Regards,
~Dietmar.

Thursday, June 25, 2009

ODTUG2009 - PDF Printing

On Tuesday I have been presenting on ODTUG Kaleidoskope 2009 in Monterey / California. The presentation was about "PDF Printing with APEX - A cost free alternative". There I have shown and detailed the integration of the open source Java reporting engine "JasperReports" into Oracle Application Express for PDF and RTF printing.

For designing the reports you can easily use the graphical design tool "iReport Designer". It will generate the report definition file for you.

The combination of JasperReports and iReport Designer is a real good alternative to the very expensive reporting solution using the BI-Publisher.

You can download the presentation slides from here.

I will make this integration available for free! Right now I have very many things on my list to do, but I will make it available in the future.

If you are interested in such an integration, please drop me a note at: dietmar.aust@opal-consulting.de.

Regards,
~Dietmar.