Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Cotumising birt parameter
Cotumising birt parameter [message #1666094] Wed, 11 March 2015 14:37 Go to next message
naruto naruto is currently offline naruto narutoFriend
Messages: 1
Registered: March 2015
Junior Member
Hello,
I'm using birt report and i wanna to use case when on my birt parameter. the default value of my parameter is 123, i want when u shoose the default value i want to get years between 2010 and 2015 else y get the result of the value of my parameter i created a parameter named paramyears and i use this query:

select table1.CA , table1.name from table1 where (params["paramyears"].values == 123 and table1.years between 2010 and 2015) or (params["paramyears"].values != 123 and params["paramyears"].values=table1.years)
Thank you
Re: Cotumising birt parameter [message #1666582 is a reply to message #1666094] Wed, 11 March 2015 19:18 Go to previous message
Jesse Freeman is currently offline Jesse FreemanFriend
Messages: 184
Registered: January 2015
Senior Member
You can use javascript in the beforeOpen of the Data Set to perform your desired logic and then override the query using this.queryText.

For Example:
if(params["paramyears"] == 123){
this.queryText = this.queryText + " where table1.year between 2010 and 2015";
}else{
this.queryText = this.queryText + " where table1.year =" + params["paramyears"];
}
Previous Topic:Radar chart
Next Topic:Canceling rendering when resultset is empty
Goto Forum:
  


Current Time: Tue Jul 23 16:02:39 GMT 2024

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

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

Back to the top