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

Conditional Query not working in Jaspersoft Studio


mits13

Recommended Posts

Hi

I am using Jaspersoft Studio 5.5. I am getting an error when I try to use conditional query ( $P!{})

I create a parameter $P{Qry) with a very simple query - select transaction_date from transaction  - of type java.lang.String  and Is for Prompting is false.

When I go to the Dataset and Query Dialog and put  $P!{Qry} it shows an error " missing SELECT at $P!{Qry}"

It does not allow me to Read fields or go ahead. I am using Postgres DB but I have also checked on Sample DB - the Language is SQL

I have checked on older verision of iReport - this same steps work succesfully there. So i am not sure what the problem is.

Is the feature no longer there or has it changed. I tried to locate an answer in the fourms but am unable to get a resolution.

Please can you help

Thanks and Many Regards

maithili

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

PFA the screen shot for Query window and also the Parameter expression window.

/sites/default/files/images/Screenshot1(3).png/sites/default/files/images/Screenshot2.png/sites/default/files/images/Screenshot4.png

Link to comment
Share on other sites

Hi Rajesh,

I went through the link and the steps are excellently explained.

But I think its not what i am looking for.

I need to change the SQL based on some condition.

For this, in the older version iReport, we can specify in a parameter and

use the parameter in the Query window for eg. $P!{SQLQuery}

 

But this is not working in Jasper Studio. Do you know why? or an alternative method?

 

Thanks and Regards

maithili

 

 

 

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...