Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Populating Map with Java Objects in Birt
nishu2587
Hi, <br />
I am facing issue with populating a Map in Birt Scripting with Java objects.<br />
Here is what I am trying to do.<br />
My DataSet returns two values- id,name from Database.<br />
I have created a simple Java POJO for these variables and on the onCreate phase of the table, I am populating my Java objects and adding them to the Map I have declared.<br />
But when I add the objects to the Map, I get a ReportServiceException.<br />
<br />
Please help me.<br />
The code details are as follows.<br />
<br />
Java Class :-<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>package com.biReports;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class TestData {
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
</pre>
<br />
<br />
Birt Script :-<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
currRow=this.getRowData();
currRowNum=row.__rownum;
obj = new Packages.com.biReports.TestData();
obj.setId(parseInt(currRow.getColumnValue("user_id")));
obj.setName(currRow.getColumnValue("user_name"));
topMap.put(currRowNum, obj); // I suspect this gives me the error.
</pre>
Find more posts tagged with
Comments
kclark
Can you post the whole error please?