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

Conditional expresion in a dataset parameter


alba.ortega

Recommended Posts

Hi all,

I have a .jrxml report connected with MongoDB. Inside this reports I have a table with many Dataset parameter in order to create dinamically the query, unfortunately I have problems with one of this parameters, it looks like:

($P{Owner}==null || $P{Owner}.equals(""))
?new String("")
:($P{Owner}.equals("Pool"))
?"$and:["OpnPrps.CurAgtNme":null,"Nms.CloAgt":null]"
:"$or:["OpnPrps.CurAgtNme":""+$P{Owner}+"","Nms.CloAgt":""+$P{Owner}+""]"
 
My problem is that when I preview my reports, the $and, $or part of my query can't be executed and I have the following error:
 
net.sf.jasperreports.engine.JRException: com.mongodb.util.JSONParseException: 
{
'findQuery' : {
"OlaDat":{'$lte':{ "$date" : 1434438846714},'$gt':{ "$date" : 1402902732089}},
$and:["OpnPrps.CurAgtNme":null,"Nms.CloAgt":null],
"Nms.Src":"e-mail"
}
 
Is there any way to change this conditions in order to get evaluable values inside a dataset parameter?
Any help,please?
 
Thanks in advance.
Kind regards.
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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