Home
Analytics
BIRT report using existing WHERE and user defined parameters
rdpeterson
<p>I have a BIRT v3.2.22 in Eclipse 3.7.1 report I'm trying to deploy in Maximo 7.5. Here's the Maximo 7.5 version info:</p><p> </p><p>IBM Maximo Asset Management 7.5.0.3 Build 20120713-1120 DB Build V7503-01<br />
Tivoli's process automation engine 7.5.0.3 Build 20120713-1120 DB Build V7503-157</p><p> </p><p>The report utilizes both existing 'where' and user defined parameters. The report accepts values entered into the existing 'where' parameter and my user defined parameters and constructs the query SQL text correctly and the report runs in BIRT designer. I then published the report in the WOTRACK module in Maximo. The report seems to completely ignore the 'where' parameter in the form of selected work order records in that module unless I completely remove all user defined parameters from the report. The IBM report development guide indicates one can use the built-in 'where' parameter with user defined parameters in a report, but this seems to be untrue. Any ideas?</p><p> </p><p>Here's the OPEN statement for my simple test report scripted query:</p><p> </p><p>maximoDataSet = MXReportDataSetProvider.create(<strong class='bbc'>this</strong>.getDataSource().getName(), <strong class='bbc'>this</strong>.getName());</p><p>maximoDataSet.open();</p><p> </p><p><strong class='bbc'>var</strong> sqlText = <strong class='bbc'>new</strong> String();</p><p> </p><p><strong class='bbc'>var</strong> where = params["where"]; </p><p> </p><p><strong class='bbc'>if</strong>(params["p_status"].value) // Add user defined, optional parameter SQL to local 'where' clause parameter</p><p>{</p><p>wo_status = MXReportSqlFormat.createParamWhereClause("workorder.status", "=" + params["p_status"].replace(/[=!,]/,""));</p><p>where = where + " and " + wo_status</p><p>}</p><p> </p><p>// if(params["p_startDate"].value)</p><p>// dateRange = " and lt.startdate between TO_DATE('" + params["p_startDate"] + "','YYYY-MM-DD') AND TO_DATE ('" + params["p_endDate"] + "','YYYY-MM-DD')";</p><p> </p><p>sqlText = "select wonum, description, status, reportdate, location"</p><p>+ " from workorder"</p><p>+ " where " + where</p><p>+ " and wo2 = 1 and wopriority between 3 and 5 and reportdate > sysdate - 1"</p><p>;</p><p> </p><p>vars["v_sql"] = sqlText; // For display of final SQL statement in the report header</p><p> </p><p>maximoDataSet.setQuery(sqlText);</p>
Find more posts tagged with
Comments
kclark
<p>Can you try to output [color=rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;]wo_status and paste it's contents here?[/color]</p>
wwilliams
<p>Did you check the Use Where Clause? when you registered the report? (it will be grayed out if you select Browser View or Direct Print)</p>