Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » report parameter with MongoDB data source
report parameter with MongoDB data source [message #1727411] Tue, 22 March 2016 20:33 Go to next message
Rajarshi Chakravarty is currently offline Rajarshi ChakravartyFriend
Messages: 6
Registered: January 2016
Junior Member
Hi,
I am trying to create a report with subreports.
For this to work I need to pass a parameter to the subreport that would contain the parent report's id field.
In traditional SQL it will be like
select name from order where user_id = ?

Edit Dataset for Mongo data source does not have a Parameter option.
How to do this?

Those who want to pass a report parameter to apply a where clause in SQL would also need the solution to this.

[Updated on: Wed, 23 March 2016 06:10]

Report message to a moderator

Re: report parameter with MongoDB data source [message #1727511 is a reply to message #1727411] Wed, 23 March 2016 12:18 Go to previous messageGo to next message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
Rajarshi Chakravarty <forums-noreply@xxxxxxxx> wrote:
> Hi,
> I am trying to create a report with subreports.
> For this to work I need to pass a parameter to the subreport that would
> contain the parent report's id field.
> In traditional SQL it will be like
> select name from order where user_id = ?
>
> Edit Dataset for Mongo data source does not have a Parameter option.
> How to do this?
>

Set the dataset's beforeOpen script to
this.queryText="select name from order where
user_id="+params["parametername"]

--
Colin Sutton
Re: report parameter with MongoDB data source [message #1727555 is a reply to message #1727511] Wed, 23 March 2016 18:59 Go to previous message
Rajarshi Chakravarty is currently offline Rajarshi ChakravartyFriend
Messages: 6
Registered: January 2016
Junior Member
Thank you Colin.
After some web search I found the beforeOpen script syntax for mongoDB to be..
this.queryText='{ "findQueryExpr" : {"organizationId" : "52afef1a86ef0f5e71000001" } , "operationType" : "FIND" , "collectionName" : "event" , "selectedFields" : [ "_id" , "name"]}'

However it returns all records. No "where" clause with "organizationId = 52afef1a86ef0f5e71000001" is applied.
Any help?

Also this will work for a report parameter that user passes but if I want to create a master-detail report, I need to have a dataset with parameter.
Am i wrong?

Previous Topic:Xpath in birt
Next Topic:How to extract plain text from HTML
Goto Forum:
  


Current Time: Thu Apr 25 11:46:00 GMT 2024

Powered by FUDForum. Page generated in 0.03657 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top