report - Dynamic query with mongodb in BIRT -


I have to create a BIRT report with 3 parameters which should be used in the query. The criteria are two dates and a string.

I tried to do this earlier, as an open dataset, has been indicated for SQL queries, but it is not working. I write first the expression dataset: "+ +", "STS": {$ gt: "'+ +" value "," operation type ":" FIND "," collectionName ": "Events", "queryReadPreference": value + '", $ lte:"' + params ["endDate"]. Value + '"}}" Secondary "," Selected Fields ": [" Ref "," STS "," RTS "," C. Value "," c. Type "," c. "," R. Value "," RTP "," R.quality "]} ';

and throwing the number of documents in the collection regardless of the query parameter.

< P> Is it possible to query queries in Birt with parameters?

Double click on your data-set, select "asset bond" and enter your function in the query function. I / P>

You should also set your query string in a global continuous vebetal and You should print on your report for debugging, make sure that your final details are valid. Your reports and databases can have dates in a different format and can not restrict your results set:

< Your data source ReportContext.getPersistentGlobalVariable ('testglobal'); // in a script of the pre> reportContext.setPersistentGlobalVariable ("testglobal", queryString); // in a dynamic text field

Comments