[Logo] SpagoWorld Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing  
[Groups] Back to home page  [Moderation Log] Moderation Log   [Register] Register /  [Login] Login 
Default value for an empty optional Input Parameter  XML
Forum Index » Technical Help - SpagoBI Server - REPORTING
Author Message
daareiza.spw

Newby

Joined: 08/07/2010 06:49:49
Messages: 21
Location: Bogotá, Colombia
Offline

Hello,

I am having problems with optional input parameters at report execution, when they are empty, the report does not execute and I get a white page.

Viewing the log file, I see this when the parameter is empty:

"net.sf.jasperreports.engine.JRException: Incompatible java.lang.String value assigned to parameter <inputURL> in the <Report Name> dataset."

Actually, that input parameter is marked as "Number" and the constraints as "Numeric", don't know why it tries to get an String.

By the way, in my report design that parameter has a default value (Integer), but the report does not execute as I have said.

Which are the default values for optional parameters when they are empty?

I suppose that the default value can't be casted to a String according to the error log.

Thanks.
aziz.spw

Newby

Joined: 12/07/2010 18:03:23
Messages: 30
Location: Paris, France
Offline

Have you done the report with ireport?
if so, what is the default value in ireport?
daareiza.spw

Newby

Joined: 08/07/2010 06:49:49
Messages: 21
Location: Bogotá, Colombia
Offline

Hi Aziz,

Yes, I have done the report with iReport and the default value for the parameter is "new Integer(111)", the report works fine when I fill all the parameters, but when a leave one optional parameter blank, the report is a white page.
aziz.spw

Newby

Joined: 12/07/2010 18:03:23
Messages: 30
Location: Paris, France
Offline

Hi Daareiza,
Have you got the error when executing directly with ireport?
If so the issue is relative to jasper ireport not to spagobi server
daareiza.spw

Newby

Joined: 08/07/2010 06:49:49
Messages: 21
Location: Bogotá, Colombia
Offline

Hi aziz,

as I said, the report execute when all the values are filled, when one optional parameter is in blank, the report doesnt execute. In iReport all works fine, with or without the optional parameter.
aziz.spw

Newby

Joined: 12/07/2010 18:03:23
Messages: 30
Location: Paris, France
Offline

Hi Daareiza,

I have done tests about this issue and I have the same probleme as you.
The default value don't work neither with integer type nor string type.
We can also see the problem in report demo "Report top right" in Examples/Analytical Model/Composed Dashboard
I think it's a bug.
Is there any body knows if theire is a patch for this bug?
aziz.spw

Newby

Joined: 12/07/2010 18:03:23
Messages: 30
Location: Paris, France
Offline

It's fixed issue in bug track.
look at this link, I hope that is usefull for you.
http://forge.ow2.org/forum/message.php?msg_id=18495
daareiza.spw

Newby

Joined: 08/07/2010 06:49:49
Messages: 21
Location: Bogotá, Colombia
Offline

Hi aziz,

thank you for your reply, it works very well.

Here is the original post for all of you:


Hi,
the problem is that when you do not valorize an analytica driver Spagobi Server send to the engine an empty string as value. The empty string is valid parameter value for jasper so it do not use the default one as expected. This managment of not valorized parameters can be improved in order to avoid this kind of problems. However for the moment I can suggets to you this workaround. In the jasper template for each parameter AAA that can be optionally valorized by the user define also another twin parameter named SAFE_AAA defined like this ...

($P{AAA} != null && $P{AAA}.trim().length() > 0) ? $P{AAA}: "my default value"

then use SAFE_AAA in place of AAA. Let me know if this work around works in your case.

Regards,
Andrea Gioia

 
Forum Index » Technical Help - SpagoBI Server - REPORTING
Go to:   
Powered by JForum 2.1.9 © JForum Team