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

SQL request problem


vergnon.corentin

Recommended Posts

Hello!

I have a problem with a SQL Request.


SELECT A,
    B,
    C,
    D
FROM `Table`
WHERE A = 'class'

I'm using this in a list. However, the list also returns tuples where A is different of class.

When I use this request on my server, it works, so I don't understand why it doesn't work on Jasper.

Do you have an idea why do I have this problem please?

Thanks a lot and have a nice day!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi vergnon, 
So need some more info on this one, maybe the log file or stacktrace issues. 
You tag says studio, so I assume this is happening on studio side ? 
So regards to WHERE A = 'class' 
'class' is a parameter right. 
If you expect a list, then change this parameter class type to be java.util.Collection
In your expression section add following new
ArrayList(Arrays.asList())

You can hardcode values if you wish to test filter scenarios on jasperstudio side. i.e.
ArrayList(Arrays.asList('value1','value2'))

On the sql side you need to use a IN keyword 
for jasper 
$X{IN, fieldtofilteragainst,  yourparametername}
i.e. $X{IN, gender,  genderlist}
I hope this is what you having issues with. 
Otherwise just post errors please.

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