Jump to content
We've recently updated our Privacy Statement, available here ×

Why doesn't $P!{} works correctly on JasperServer?


alexshtanin

Recommended Posts

In Jasper Studio, i created new Jasper Report with SQL srcript 
```
select * from
(
SELECT 1 v from dual union all 
SELECT 5 v from dual union all 
SELECT 4 v from dual union all
SELECT 2 v from dual union all
SELECT 3 v from dual
) da
$P!{P_C}

```
there are two Parameters:
```
    <parameter name="P_P" class="java.lang.Boolean"/>
    <parameter name="P_C" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA[iF($P{P_P},"where da.v =1","")]]></defaultValueExpression>
    </parameter>

```
When i run this report in Jasper Studio then everything is works fine and result is as expected:
```
_________
TEST REP|
________|
V       |
________|
1       |
2       |
3       |
4       |
5       |
```
But on JasperServer i get an error:
```
There was an error on the server. Try again or contact site administrators. (Error UID: 16864f27-a17a-43d1-8ed6-4386b52f57a0)
```
If i delete `$P!{P_C}` from SQL script, every thing works fine.

Version of TIBCO Jaspersoft® Studio is 6.9.0 

Version of Jasper Server is 7.2.0

If there is anybody who has the same thing?
 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

P_C is my WHERE clause

As you can see i've used ! in my SQL with parametr $P!{P_C}. 

The value of  P_C parametr is set to where da.v =1 when P_P parametr is true and "" when P_P parametr is false

I want to remove(or modify) WHERE clause in SQL depending on whether the parameter P_P is set or not.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...