Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
8 years ago

How to get output as HTML table with newResult()

Hi , This is my code .I'm trying to get output in table format. but its not resulting in any output or any error.  
Innovator inn = this.getInnovator();
ItemCount = 0;
Item newqry = inn.newItem("Baxter_system","get");
newqry.setAttribute("select","baxter_part_number,baxter_system");
newqry.setProperty("baxter_part_number","GE3400");
newqry.setPropertyCondition("baxter_part_number","eq");
item results = newqry.apply();
ItemCount = results.getItemCount();
int i ;
string content = "

"; try{ for (i=0; i<ItemCount; ++i) { Item item = results.getItemByIndex(i); content += "" + "" + "" +
"" +
"";
}
content += "
<table>
<tbody>
<tr>
<td>" + item.getProperty("baxter_system") + "</td>
<td>" + item.getProperty("baxter_part_number") + "</td>
</tr>
</tbody>
</table>
";
}
catch(Exception e)
{}
Innovator innovator = this.getInnovator();
return innovator.new(content);
 

2 Replies

  • Is it a typo? in your code it sems like you typed innovator.new(content) instead of innovator.newResult(content) You realize you also instanciated innovator twice? (which is not the error of course)