Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Passing Parameters according to a parameter
Waleed
Hi All,
Im trying to pass parameters which depends on another parameter,below is my code but seems its not the right way to do it,anyone can help on this.
var ReportType = params["Report_Type"];
var sqlText = new String();
// Add query to sqlText variable.
sqlText = "select item.itemnum,item.assetdesc from item"
// Include the Maximo where clause
+ " where " + params["where"]
if(ReportType = 'Single Group'){
+ " and item.itemnum = '" + params["Single_Group"] + "' "
}
if(ReportType = 'Range Group'){
+ " and item.itemnum between '" + params["From_Group"] + "' and '" + params["To_Group"] + "'"
}
;
I'm using Birt 2.3.2
Thanks In Advance
Find more posts tagged with
Comments
mwilliams
Hi Waleed,
What script method are you putting this this code in? Also, is this all the scripting you do?
Waleed
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>Hi Waleed,<br />
<br />
What script method are you putting this this code in? Also, is this all the scripting you do?</p></blockquote>
<br />
Hi mwilliams,<br />
<br />
Im putting this code in the open method,and in the fetch method im putting the below code :<br />
<br />
if (!maximoDataSet.fetch())<br />
return (false);<br />
<br />
// Add a line for each output column<br />
// The specific get method should match the data type of the output column.<br />
row["itemnum"] = maximoDataSet.getString("itemnum"); <br />
row["assetdesc"] = maximoDataSet.getString("assetdesc"); <br />
<br />
return (true);<br />
<br />
My problem is in the if statement, the code is not looking at the if statements.<br />
<br />
Thnx for ur reply
pricher
Hi Waleed,
In the condition of your if statement you need 2 equal signs to test on equality, not one. Your condition should look like this:
if(ReportType == 'Range Group'){
Hope this helps,
P.