Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use params["where"] ??
peraka
Hi All,
I've a requirement to use params["where"] to capture the current workorder number from the Maximo workorder screen as a parameter.
Always it is passing null in the query, do I have to do some binding in the report properties ??
Please let me know your valuable suggestions.
Thanks,
Suresh.
Find more posts tagged with
Comments
micajblock
Did you create a report parameter named 'where' ?
mwilliams
Like Mica said, you'll need to have a report parameter in your report called "where", to pass it through. Then, you can use this parameter within your dataSet to pass the appropriate value to your query. If you've already got this set up, what all have you done to try to pass the value in?
peraka
Hi Williams,
I'm using params["where"] as below
whereClause= " 1=1 "
if ( params["where"].value.length > 0) {
whereClause += " and " + params["where"] ;
}
select * from workorder where +whereClause
when I deploy this report in Maximo, it is passing null and doesn't return any value. I tried to print the query in eclipse too, it's passing null
as you said there is a where parameter in report parameters.
Please let me know how to go ahead.
thanks,
suresh.
micajblock
Looks right to me. As far as I know this is how it is supposed to work.
peraka
But it always return empty dataset. When I print the query in eclipse it's passing null.
Also can I have other report parameters along with this ?
micajblock
If it passes null then you should get all the workorders not an empty result set all you should have is 1=1.
Yes you can have additional parameters you just need to define them when you upload the report to Maximo.
It is possible that you need to define the where parameter in Maximo also (although I thought this would be done for you).
wwilliams
Why don't you look at some of the out of the box reports?<br />
+ " where " + params["where"]<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
+ " from workorder "
// Include the Maximo where clause
+ "where " + params["where"] + " and workorder.istask = 0 "
if (params["loc"].value)
sqlText = sqlText + " and workorder.location like '" + params["loc"] + "%'"
+ " and workorder.status <> 'CAN' "
+ " and workorder.reportdate >= " + MXReportSqlFormat.getStartDayTimestampFunction(params["sDate"])
+ " and workorder.reportdate < " + MXReportSqlFormat.getEndDayTimestampFunction(params["eDate"])
</pre>