My query in Jasper got CLOB data, but I'm not able to display it in my report, I even tried some of the solution that I found in this forum.
Both of these were not working:
new BufferedReader(new InputStreamReader($F{clob_data}.getAsciiStream())).readLine()
$F{clob_data}.getSubString( 1l, ( new Long( $F{clob_data}.length() ) ).intValue() )
even debug with no error, after run it in web application, it will show:
error=net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : ...
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to oracle.sql.CLOB
The CLOB field in my report:
<field name="clob_data" class="oracle.sql.CLOB"/>
And this is how I display my CLOB field:
<textFieldExpression class="java.lang.String"><![CDATA[$F{clob_data}.getSubString( 1l, ( new Long( $F{clob_data}.length() ) ).intValue() )]]></textFieldExpression>
<textFieldExpression class="java.lang.String"><![CDATA[new BufferedReader(new InputStreamReader($F{clob_data}.getAsciiStream())).readLine()]]></textFieldExpression>
There is no textFieldExpression for class="oracle.sql.CLOB"
Any easy way to handle this?
Update: My problem would be like this guy, still no solution:
http://iswwwup.com/t/1b800f433463/how-jasperreports-display-clob-field-with-html-tags.html