I am trying to work with iReport (new to it) for my Seam/JSF web app. I have a page that displays a table of data supplied by a backing bean. The data is contained in a List and displayed in a RichTable.

I need a link on the page to produce the same table of data into a PDF, nicely formatted. SO, I am looking at JasperReports.

In iReport, I don't know how to point to the backing bean List attribute as my data source. Is that even possible? Is there a baby-steps guide on how to link these things together?

Unfortunately, this is an app that's already designed, using Richfaces. I don't have authority to redesign all the pages with Primefaces. I need to get JasperReports working for this feature. The page with the data table is just a simple example, there are others required within the app.

I came to the same conclusion. The jasperreports-jsf library needs a lot of additional work to make it useable. At the moment I am making a Seam component which reads and compiles a jasper report file made in iReport and send it to an email handler using an Asynchronous method on another bean. In this way I have a completely independent email handler for reports. My next step is using the DB to store the reports (via a upload page) which makes stuff more flexible. My approach is more generic so I think it should be possible to use it also for Birt reports.

I feel like a dunce, but all of this is new to me.I tried using iReport, but for the life of me it will not read data from my Java bean. I have a backing bean that contains the data for the page. It's called AuthorizationFormsAllLevelsManager wired into Seam with @ name authorizationFormsAllLevelsListManager. The xhtml page references authorizationForms (List of AuthorizationFormsAllLevelsRowObject) in a rich table element from that bean. That is my data source. How do I expose it to iReport? Or, barring that, how do I just create a report in iReport and then edit it to put in the attributes from the bean List forcefully? ;)

Thanks,Ginni

PS I tried JBoss Seam PDF, which will do the job, but requires too much duplicated code for our taste since it will not act on RichTable etc and requires its own p:table...

I see in this code that the parameter resultList isn't used, but assume it could be in the place of the drb.addColumn... with some iteration through the list items to do the same? Am I reading that right? I am still learning java, so I am just not sure.

Okay, disregard, I see resultList is used.If my objects in my authorizationForms list are not simple, as in they have attributes that are other objects... how do I refer to those attributes? Within my page, I do so like:

#{record.authorizationForm.formTitle}

I am guessing that in the line:

.addColumn("Description", "description", String.class.getName(),30)

description is an attribute of the InfraWebLogentry class.

So, would I put something like authorizationForm.formTitle there?Thanks!

Additionally I will try to finish a component this week to store JasperReport (jrxml) files in the DB for further processing. I prefer using iReport to make these files, because changing reports is very labourous. The program has some really funny behaviour, but with some practising you can work with it. Two impoprtant reminders:

- You must adapt the classpath of iReport to be able to use your entities (under properties),- It additionally needs a kind of Helper class with a static method to access a Collection of your entities. This is needed if you use the Bean collection datasource. This class is NOT needed for further processing, only for design.

Hi Leo, have you finished the component you mentioned in your post? What is the current status of the question? Is there a step by step guide how to integrate Jasperrports to an existing (seam-gen generated) project?

Yes, I've made a Seam-2 component to load different types of reports (including JasperReport files). I also made a DB-loader which enables you to store the Report in the DB and retrieve it on the fly.

To be honest, At the end I used the included Seam renderer for Templates and made and extended it with a DB-Resouice loader. The templates are not really "dummy-user-friendly", but with a bit of practice yoy can create beautiful multi-table reports which is really a lot of work with Jasper (you need subreports to do the trick). The JBoss tools/Eclipse xhtml editor gives you a nice WYSIWYG and helps you with the templates.

Pity is the sudden move of the Seam dev.team to Seam-3 which let's you out in the cold with the "obsolete" Seam-2 stuff. If you are starting new development just use CDI.