giovedì 2 agosto 2012

SpagoBI - Gestione valori default JasperReport

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.