Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Dynamic where clause in Birt
Dynamic where clause in Birt [message #915642] Mon, 17 September 2012 17:17 Go to next message
Vani Ra is currently offline Vani RaFriend
Messages: 11
Registered: September 2012
Junior Member
Here is a question, probably not something new, but I am kind of stuck.

I want to dynamically pass the where clause to birt to generate a report for me. I know how to pass parameters to Birt report but this is something totally different.

My where clause changes altogether in different scenarios. Actually am designing a search page which has many parameters and report is generated based on the values entered by the user. sometime user fills 2 fields and other times he might fill 10 fields.

Say at first, my query is Select * from xx where empNo. is yy

and second time it might be Select * from xx where salary Between 100 and 200

So In short, my where clause is very dynamic. and I want to keep where clause as a parameter and want to pass it to Birt manually at run time instead of pre defining it in data set. Is it possible to meet such requirement ?

Please reply.


Thanks
Re: Dynamic where clause in Birt [message #915661 is a reply to message #915642] Mon, 17 September 2012 17:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If the structure of the returned resultset does not change, this is very simple. In your example put the select * from xx in the designer. Then in the beforeOpen event handler script put in a script similar to this:

this.queryText = this.queryText + " " + params["youwhereclauseparameter"].value;


Jason
Re: Dynamic where clause in Birt [message #915671 is a reply to message #915661] Mon, 17 September 2012 18:15 Go to previous messageGo to next message
Vani Ra is currently offline Vani RaFriend
Messages: 11
Registered: September 2012
Junior Member
awsome Smile

thanks

For future reference, is there any tutorial on such things ? which explains all the features of Birt ?

[Updated on: Mon, 17 September 2012 18:39]

Report message to a moderator

Re: Dynamic where clause in Birt [message #915709 is a reply to message #915671] Mon, 17 September 2012 20:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

We have some older tutorials here:
http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1/querymod/index.php

But on Birt-exchange.org there are a lot of examples. I am also attaching an example.

Jason
  • Attachment: querymod.zip
    (Size: 2.96KB, Downloaded 154 times)
Re: Dynamic where clause in Birt [message #1385496 is a reply to message #915709] Sat, 07 June 2014 11:48 Go to previous messageGo to next message
swapna patro is currently offline swapna patroFriend
Messages: 1
Registered: June 2014
Junior Member
I am not able to download the specified zip file.Please provide me a example file.

Regards,
Swapna.
Re: Dynamic where clause in Birt [message #1385579 is a reply to message #1385496] Mon, 09 June 2014 17:06 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

I attached the file in your post on the BIRT Developer Center. Hopefully you can download it from there.

Michael

Developer Evangelist, Silanis
Previous Topic:Getting a "The file has been deleted" error that won't allow me to edit some reports
Next Topic:Birt / Eclipse Workspace corruption
Goto Forum:
  


Current Time: Fri Jul 03 10:49:43 GMT 2015

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

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