Jump to content
We've recently updated our Privacy Statement, available here ×

How to run IReport from code


b0ss

Recommended Posts

Hi,

I am trying to integrate iReport with our application.

Idea is that our application can provide to iReport some sort of data(as JavaBeens set), template file, and  and then, user can edit template, generate report and save it as some sort of printable document. IReport will be started from our application.

But,  I am new in using IReporter, I have several problems:

-How can I run Ireporter designer app  from source code of our application? Which class is start point for running iReporter, and which parameters I must provide?

-I want to automatic set JavaBeenDataSource when IReport designer window is activated. Is there a way to do it?

-Is there a way to automatically add jar file with my been classes to class path of Ireporter?

-Can I somehow automatically, after starting IReporter add all fields found in my JavaBeen jar file to Fields node of ReportInspector Tree?

I would prefer not to change source of iReporter and not to use windows registry for storing configurations. It is best to do all coding in our application. Is this possible?

Best regards ,

Marjan

Post Edited by b0ss at 06/28/2010 14:31



Post Edited by b0ss at 06/28/2010 14:32
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

Unfortunately I have the same troubles as you, using the iReport NetBeans. This is possible and very easy for iReport 3.0.x (the old one, before NB).

I'm asking similar question here: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=76331

But no answer so far...

I think you can try overriding the validate() method in the Installer.class in com-jaspersoft-ireport.jar. This method is called before the module is started and you can place there the code, needed to be invoked before the iReport is started.

But in my case this is not enough, since I have service loaders and they just don't find anything anymore.

If the old iReport 3.0.x is suitable for you, you can start it very easy from your app with this code:

it.businesslogic.ireport.gui.MainFrame.main(args);

Not that this doesn't work with NetBeans, because NetBeans wants to load the whole world before starting the real application...

I think it would be nice if the next iReport provides a way to extend it in a way that:

- is possible to add jars in the ext folder and they are visible automatically for the iReport

- is possible to add a startup code, without hacking the jar and replacing the Installer.class

- explain which service loaders are used in the iReport and how to make custom services visible to them

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...