BIRT data set prints same data for every itme
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">I have a BIRT report for Maximo with two scripted data sets. The main data set for purchase requests and the sub data set for purchase request lines. The problem is that the sub data set works fine for a single purchase request and prints the correct data for any give PR, but if you run the report for multiple PR's, the pr lines for the first PR are printed out for every PR.</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">So what I am getting is something like this.</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">PR 10</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Line 1</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Line 2</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">PR 20</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Line 1</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Line 2</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">When PR 20 should have 10 lines, it only gives me two and those two are the same lines as PR 10. I've set the report to print out the SQL that is being created by the data set by populating a global variable called mySQL and printing that on the report. The SQL looks fine and I can cut and paste it into my SQL editor and get the correct results, but that is not what is printing out on the report. I've checked table bindings, I've tried to null out the data set in the script and force it to repopulate but that has no effect. I've created a new data set, but the new data set does the same thing.</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Has anyone run into this before? Any ideas at all on what to check? Or how do I go about clearing out the dataset for each PR so that the PRLINE dataset will be clean for each PR?</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">This is the open script for the dataset.</p>
<p>lineDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());<br>
lineDataSet.open();<br><br>
var sqlText = new String();<br><br>
// Add query to sqlText variable.<br>
sqlText = "select orderqty, orderunit, itemnum, description, unitcost, linecost, prnum, prlinenum, refwo, assetnum, location, project,tasknum, siteid from maximo.prline_vw "<br>
+ " where prnum = '" + rows[0]["prnum"].replace(/'/g,"''") + "'"<br>
+ " and siteid = '" + rows[0]["siteid"] + "'"<br>
//+ " where prnum = '" + row._outer["prnum"] + "'"<br>
//+ " and siteid = '" + row._outer["siteid"] + "'"<br>
// Include the Maximo where clause<br>
//+ " and " + params["where"]<br>
;<br><br>
lineDataSet.setQuery(sqlText);<br><br>
mySQL = sqlText;</p>
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">And this is the fetch script.</p>
<p>if (!lineDataSet.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["prlinenum"] = lineDataSet.getString("prlinenum");<br>
row["orderqty"] = lineDataSet.getFloat("orderqty");<br>
row["orderunit"] = lineDataSet.getString("orderunit");<br>
row["unitcost"] = lineDataSet.getFloat("unitcost");<br>
row["linecost"] = lineDataSet.getFloat("linecost");<br>
row["prnum"] = lineDataSet.getString("prnum");<br>
row["itemnum"] = lineDataSet.getString("itemnum");<br>
row["refwo"] = lineDataSet.getString("refwo");<br>
row["siteid"] = lineDataSet.getString("siteid");<br>
row["description"] = lineDataSet.getString("description");<br>
row["project"] = lineDataSet.getString("project");<br>
row["tasknum"] = lineDataSet.getString("tasknum");<br>
row["assetnum"] = lineDataSet.getString("assetnum");<br>
row["location"] = lineDataSet.getString("location");<br><br><br>
return (true);</p>