PDA

View Full Version : PARAMETERISED JasperReports with pentaho



karanbhalla
06-26-2006, 03:08 AM
hi all,

I am trying to use JasperReports with pentaho. The datasource is my own mysql database. In the report, there is a parameter 'DOMAIN' which "is for prompting". I followed the steps in Creating Pentaho solution to create the corresponding .xaction.
Now the problem is that when i run the report it does not prompt for the parameter. And if i give a "default value" while declaring that parameter as a report input, it takes the default value and gives the corresponding report.In this case also, the report layout is not the same as shown by "iReport"
If what i said above is not clear, then please note that the function that i require my report to do is analogous to the function of "jasper-reports-test-2.xaction" among the samples provided.The place where my report is failing is that it does not
prompt for the parameters. I am attaching the corresponding files:
1. domain.jrxml
2. domain.xaction
3. server log file

The default values that you may try with are "ERP" and "IT Outsourcing". But ofc you wont get any result for that as the database is not there.

Platform details:
Jboss4.0.3 server, pentaho j2ee deployment1.1.6, iReport1.2.2, Creating pentaho Solution1.1.6, Design Studio1.1.5

Please check if you can help me.
Thanks
--Karan
http://forums.pentaho.org/archived_att/files/Files_for_Reference.zip

Post edited by: karanbhalla, at: 06/26/2006 07:10

Post edited by: karanbhalla, at: 06/27/2006 00:37

Nik
06-27-2006, 08:46 PM
hi all,

I am facing the same problem as karan and unable to run jasperReports with pentaho.
Well if its a static report and does not require entering any parameters, it works fine, but when i need a parameter to be entered, the value of which is then passed to the "where" clause in query,it gives a blank screen.
my resources are the same : mysql database,PCI 1.1.5,iReport1.2.2, Design studio1.1.5.

Any help would be greatly appreciated.

Thanks
Nik

mbatchelor
06-28-2006, 09:09 AM
Have you seen the parameterized Jasper report in the samples/reporting solution?

dmoran
06-28-2006, 09:19 AM
Karan,

Sorry for the trouble.

From the server.log, I saw:

2006-06-26 15:34:01,499 ERROR [STDERR] java.lang.NullPointerException
2006-06-26 15:34:01,499 ERROR [STDERR] at org.pentaho.messages.Messages.getEncodedString(Messages.java:49)
2006-06-26 15:34:01,499 ERROR [STDERR] at org.pentaho.core.runtime.RuntimeContext.sendFeedbackForm(RuntimeContext.java:1613)
2006-06-26 15:34:01,499 ERROR [STDERR] at org.pentaho.core.runtime.RuntimeContext.executeSequence(RuntimeContext.java:807)

which was a known bug in 1.1.6 and was fixed in 1.1.7.

I tried your xaction in 1.1.7 - released today (6/28) - and it worked. You can also try adding text to the <help> XML node which is used to build the prompt. If you are using Design Studio, you can add help text on tab "1. General"

Doug

dmoran
06-28-2006, 09:25 AM
Yes - and it works because it has help text - see:
http://forums.pentaho.org/showthread.php?t=26571

BTW The error reporting has been GREATLY improved in version 1.1.7

;)

Doug

karanbhalla
06-28-2006, 10:56 PM
hi,
Thanks Nik, Marc and Doug for the reply's.

well i did check the examples and also mentioned that the functions of my report are analogous to the example.
n doug i think we need to give both the help text and the description text to make it work in the earlier versions. cause i tried giving only the help text and it failed to work.
I think i'll take your advice and download the 1.1.7 release. I was actually avoiding that till nw since i was against a deadline and din't wanna spend time in the deployments.

I have a coule of questions more:

1) Why is it that when i view the report as pdf, all the fields are displayed fine and the layout is exactly the way i want.But when i view the same report as html, the layout is different and some of the fields are missing??

2) Can i add a SecureParam component along with the JasperReport component to allow the user to select from a pulldown list rather than a edit textbox??

Thanks

--Karan

dmoran
06-29-2006, 01:18 AM
Karan,

I am not sure why The HTML and PDF are different. Since the output comes directly from the JasperReports Component, I assume it is an issue with the JasperReports engine. Prior to 1.1.7, we were using an older version of JasperReports and maybe it's an incompatibility with the report definition created with iReport 1.2.2 and the older version. In 1.1.7 we upgraded to the latest version of the engine.

The SecureFilterComponent is the way to go for adding parameter selections.

Doug