Hot questions for Using JasperReports in oracle


I have an error using Jaspersoft Studio with Oracle Database. As soon as there is some data, the following line

<printWhenExpression><![CDATA[$P{REPORT_TYPE}.substring(0,1)=="R"? $F{REASON_DELETED}:$F{REASON_ADOC}]]></printWhenExpression>

throws the following error:

net.sf.jasperreports.engine.JRException: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean

I don't understand, why Jasper Studio would cast it to a Boolean, since it is defined as a String:

<field name="REASON_ADOC" class="java.lang.String"/>
<field name="REASON_DELETED" class="java.lang.String"/>

and the SQL is also fine to me:

NVL(cr.REASON_ADHOC,'-') AS reason_adoc,
NVL(cr.REASON_DELETED,'-') AS reason_deleted,

and also in the view/table:



You're right, your expression returns a String. But printWhenExpression expects boolean expression as a content. According to docs:

printWhenExpression Definition of a Boolean expression that will determine if the element or the band should be printed or not.

It's not clear what are you trying to achieve. You might want to use textFieldExpression instead.


I have a client who wants to maintain their Oracle report xml for printing their Statements but I am using java and jasper reports to generate the PDF reports. The xml goes to a third party for printing. Is there a way by any means of invoking or development I can generate the same oracle report xml. I have googled to no avail. This is the Oracle report xml formating:

<?xml version="1.0"?>
<!-- Generated by Oracle Reports version -->

Any ideas, example or links will be appreciated.



try this :

Example Line

Writing out a DOM object for xml eg

Oracle XML Schema Details

Oracle Developer's XML kit




Oracle Apex' Interactive Reports offer quite a lot for end users - your (I mean, developer's) query might look likeselect * from ..., and end user can then select columns he wants, group them, perform filters, aggregates, draw charts ... Really nice. Best of all: it is Oracle, and it is free.

Printing, though, isn't that simple, but - from my experience, users (for some reason) adore Excel. Regarding the fact that you can easily download report into Excel, that might suit their needs.