Unfortunately, iReport doesn’t have a field definition for Clobs and the Informix JDBC will report the Clob data field as a String when asked. There is a solution to this dilemma. A ClobInflator class was created in the com.jaspersoft.ps.maricopa package. Sample usage inside your custom datasource:
for (; rs.next();) {
ArrayList smallList = new ArrayList();
String clobString = “”;
for (int i = 1; i < colCount + 1; i++) {
Object nextObject = rs.getObject(i);
if (i == CLOB_FIELD_INDEX) {
java.io.InputStream ip = rs.getAsciiStream(i);
ClobInflater cI = new ClobInflater();
clobString = cI.getClobString(ip);
}
if (i == CLOB_FIELD_INDEX) {
smallList.add(clobString);
}
else {
smallList.add(nextObject);
}
}
queryDataList.add(smallList);
}
Of course this depends on you knowing that your field is a Clob type. These types are labled as “text” types in Informix.
Feeling so much pain, to display a clob field on ireport, kindly help me asap.
thank you.