View Full Version : How to make Jfree report with parameter UI?

11-06-2005, 05:53 AM
I'm new one with pentaho.
I'm trying to move my report and query project, which is developed by RCP and JFree, to pentaho+jfree component. But every report or query have several parameters.
How to develop UI in pentaho? Now, I use a jsp as UI page, and submit the parameter value to the report sollution.
There are several problems,
1. How the jfree component query data with the parameter? I noticed there are two mode with jfree components, sqlMode or not. My project can't use sqlmode, because the data is belong to several table and I have to do something with the data. And the most important, we have implemented the report project, we want to use the report data generate logic in pentaho. The report project use hibernate2 as the O-R mapping tools. I can't use jarMode too, because it can't recieve any parameters. The jarMode seem to new instance a TableModel class, but don't transfer the parameter to the new object.

2. I hope the report parameter UI can be in same solution with report generate solution, just like BIRT.

Thanks the pentaho team for providing the great open source project.

11-09-2005, 04:02 PM
Hi there!

I'm glad you asked that question. In the current release, you're absolutely right - passing parameters to the tablemodel isn't supported. However - the code I just checked in will take care of this. Here's what you'd need to do.

In your tablemodel implementation, you'd need to have the following method:

public void setParameters(Map someMapName) {

The map that gets passed in will contain the input parameters (defined in the action sequence) as the key, and the parameter value that was selected/input by the user.

Thanks for pointing out the missing functionality!

Take care,

Marc Batchelor

Edit: Clarification - The changes I made were to the JFreeReportComponent. But, as far as I can tell, you can't just get this single class, and have everything else work. You'd need to get all the code from CVS. But, this functionality will be included in the next release. Thanks again!

Post edited by: mbatchelor, at: 11/09/2005 20:09