Hot questions for Using JasperReports in oracle

Question:

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:

REASON_DELETED  VARCHAR2(250)
REASON_ADHOC    VARCHAR2(4000)

Answer:

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.

Question:

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 6.0.8.18.0 -->
<CDSTXN05>
  <LIST_G_CLIENT_PREFIX>
    <G_CLIENT_PREFIX>
      <CLIENT_PREFIX>0000xxxxxxxxx0</CLIENT_PREFIX>
      <CLIENT_SUFFIX>LI</CLIENT_SUFFIX>
      <JOINT_AC_NO>0</JOINT_AC_NO>
      <LIST_G_MEMBER_CODE>
        <G_MEMBER_CODE>
          <BROKER>B12-B</BROKER>
          <MNAME>CUSTOMER NAME</MNAME>
          <MADD1>CUSTOMER ADDRESS</MADD1>
          <MADD2>CITY</MADD2>
          <MADD3>FINANCE HOUSE</MADD3>
          <MTOWN></MTOWN>
          <MCOUNTY></MCOUNTY>
          <MSTATE></MSTATE>
          <MPOSTCODE></MPOSTCODE>
          <MCOUNTRY>COUNTRY</MCOUNTRY>
          <MEMBER_CODE>B1</MEMBER_CODE>
          <MEMBER_TYPE>B</MEMBER_TYPE>
          <M_COUNTRY_CODE>CD</M_COUNTRY_CODE>
 ''''''''''''''''''''''''''''''''''''''''''''

Any ideas, example or links will be appreciated.


Answer:

EDITED

try this :

Example Line

Writing out a DOM object for xml eg

Oracle XML Schema Details

Oracle Developer's XML kit

1:

Question:


Answer:

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.