alba.ortega Posted June 16, 2015 Share Posted June 16, 2015 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 More sharing options...
alba.ortega Posted June 16, 2015 Author Share Posted June 16, 2015 Ok I found the mistake myself, the problem was I missed two { } between objects. $and:[{"OpnPrps.CurAgtNme":null},{"Nms.CloAgt":null}] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now