Java action problem with populate IDataTable into IDataSetResult

0
Hi everyone, I need a help. I got a successful IDataTable after excetued this command "IDataTable table = Core.retrieveOQLDataTable(this.getContext(),query);" and I like to populate all IDataTable into IDataSetResult I tried to many ways to make it successful but always fail. Like : IDataTable table = Core.retrieveOQLDataTable(this.getContext(),query); List rowList = table.getRows(); for( IDataRow row : rowList ) { String EmployeeID = row.getValue(this.getContext(), Employee.MemberNames.EmployeeID.toString()); String FirstName = row.getValue(this.getContext(), Employee.MemberNames.FirstName.toString()); LinkedHashMap<string, object=""> params = new LinkedHashMap<string, object="">(); params.put("EmpID", EmployeeID); params.put("EmpName", FirstName); result.addRow(params); or Object rowValues = row; result.addRow(rowList); But, they don't work What is the right way to use addRow method? addRow(java.lang.Object... rowValues) Adds a new row to the report with the given values for each column.
asked
1 answers
4

You only need to pass the values for each column of the row to that method, not a map containing name/value pairs.

In your case it'll look something like this:

IDataTable table = Core.retrieveOQLDataTable(this.getContext(), query);
for (IDataRow row : table.getRows()) {
    String employeeID = row.getValue(this.getContext(), Employee.MemberNames.EmployeeID.toString());
    String firstName = row.getValue(this.getContext(), Employee.MemberNames.FirstName.toString());
    result.addRow(employeeID, firstName);
}
answered