How to create report which will show only information from one record? (javascript needed) [message #848690] |
Wed, 18 April 2012 13:39 |
Dejan Vujanic Messages: 67 Registered: October 2011 |
Member |
|
|
Within some IBM application I want to run report from specific record and for that record automatically to be shown only it's information. But I keep getting information from all records from database (I am getting the list instead of one record).
I created table with one row and there put grid with many rows and two columns:
I want it like in this form:
FIELD1: VALUE1
FIELD2: VALUE2
FIELD3: VALUE3 ....
I think that I need to create script data set with open and fetch method:
Open:
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
maximoDataSet.open();
var sqlText = new String();
sqlText = "select workorder.workorderid, workorder.wonum, workorder.description, workorder.status "
+ "from workorder"
;
maximoDataSet.setQuery(sqlText);
Fetch:
if (!maximoDataSet.fetch())
return (false);
row["workorderid"] = maximoDataSet.getString("workorderid");
row["wonum"] = maximoDataSet.getString("wonum");
row["description"] = maximoDataSet.getString("description");
row["status"] = maximoDataSet.getString("status");
return (true);
I do not know what am I doing wrong. My simple example file is attached. But as result I am getting many grids, I just want one record that runs that report. How to restrict it?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.02022 seconds