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 13:17 Go to next message
Vani Ra is currently offline Vani Ra
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 13:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
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 14:15 Go to previous messageGo to next message
Vani Ra is currently offline Vani Ra
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 14:39]

Report message to a 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
Jason Weathersby is currently offline Jason Weathersby
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 87 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
swapna patro is currently offline swapna patro
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 13:06 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1560
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

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
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: Thu Aug 28 23:34:19 EDT 2014

Powered by FUDForum. Page generated in 0.01717 seconds