Skip to main content



      Home
Home » Archived » BIRT » Dynamic where clause in Birt
Dynamic where clause in Birt [message #915642] Mon, 17 September 2012 13:17 Go to next message
Eclipse UserFriend
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 13:47 Go to previous messageGo to next message
Eclipse UserFriend
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 14:15 Go to previous messageGo to next message
Eclipse UserFriend
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 14:39] by Moderator

Re: Dynamic where clause in Birt [message #915709 is a reply to message #915671] Mon, 17 September 2012 16:21 Go to previous messageGo to next message
Eclipse UserFriend
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 556 times)
Re: Dynamic where clause in Birt [message #1385496 is a reply to message #915709] Sat, 07 June 2014 07:48 Go to previous messageGo to next message
Eclipse UserFriend
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 13:06 Go to previous message
Eclipse UserFriend
I attached the file in your post on the BIRT Developer Center. Hopefully you can download it from there.
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: Wed Jul 23 03:03:44 EDT 2025

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

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

Back to the top