cancel
Showing results for 
Search instead for 
Did you mean: 

Report fails when POJO property is null

Former Member
0 Kudos

<p>If a POJO property in my report is null, then the report fails. Initially, I thought it was in the RAS api only, but I just determined that is not the case. I get the error regardless. This is currently making CR4E completely unusable for me. Any ideas if this is a bug or if I&#39;m doing something wrong? If it is a bug, any good workarounds?</p><p>&nbsp;</p><p>Thanks</p><p>----


</p><p>&nbsp;</p><p>Some stack trace below...</p><p>&nbsp;</p><p> [ERROR] 10:54:17,019 <br /> com.crystaldecisions.reports.reportdefinition: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Unexpected null value found for member RptObj.getValue.<br />[ERROR] 10:54:17,019 <br /> com.crystaldecisions.reports.dataengine.datasource: Failed to read next recurring database record: database row set error.<br />com.crystaldecisions.reports.reportdefinition.datainterface.j: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.reportdefinition.datainterface.q.a(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.m(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.l(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.if(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.p.aB(Unknown Source)<br /> at com.businessobjects.reports.sdk.b.b.byte(Unknown Source)<br /> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b2.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)<br /> at com.crystaldecisions.report.web.event.av.a(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source)<br /> at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)<br /> at com.crystaldecisions.report.web.ServerControl.processHttpRequest(Unknown Source)<br /> at java.lang.Thread.run(Thread.java:595)<br />Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.queryengine.driverImpl.n.if(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.ap.if(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.l.bN(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.ap.eg(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.ap.e(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.b2.f(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.b2.dy(Unknown Source)<br /> ... 105 more<br />Caused by: com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSetException: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSetException.throwPOJOResultSetException(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSet.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSet.do(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSet.getDouble(Unknown Source)<br /> ... 112 more<br />[ERROR] 10:54:17,049 <br /> com.crystaldecisions.reports.dataengine.datasource: Failed to regenerate saved records: cleaning up errors.<br />[ERROR] 10:54:17,049 <br /> com.crystaldecisions.reports.dataengine.datasource: Failed to do first pass: failed to regenerate saved records.<br />com.crystaldecisions.reports.dataengine.be: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.dataengine.n.m(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.l(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.aa(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.if(Unknown Source)<br /> at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at

com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.p.aB(Unknown Source)<br /> at com.businessobjects.reports.sdk.b.b.byte(Unknown Source)<br /> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b2.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)<br /> at com.crystaldecisions.report.web.event.av.a(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source)<br /> at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)<br />Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.j: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.reportdefinition.datainterface.q.a(Unknown Source)<br /> ... 104 more<br />Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.queryengine.driverImpl.n.if(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.ap.if(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.l.bN(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.ap.eg(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.ap.e(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.b2.f(Unknown Source)<br /> at com.crystaldecisions.reports.queryengine.b2.dy(Unknown Source)<br /> ... 105 more<br />Caused by: com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSetException: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSetException.throwPOJOResultSetException(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSet.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSet.do(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.internal.POJOResultSet.getDouble(Unknown Source)<br /> ... 112 more<br />[ERROR] 10:54:17,170 <br /> com.crystaldecisions.reports.dataengine.datasource: Failed to do first pass, clean up error.<br />[ERROR] 10:54:17,170 <br /> com.crystaldecisions.reports.formatter.formatter.objectformatter: com.crystaldecisions.reports.dataengine.be: JDBC Error: Unexpected null value found for member RptObj.getValue.<br />[ERROR] 10:54:17,170 <br /> com.businessobjects.reports.sdk.JRCCommunicationAdapter: JRCAgent13 detected an exception: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.p.aB(Unknown Source)<br /> at com.businessobjects.reports.sdk.b.b.byte(Unknown Source)<br /> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b2.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)<br /> at com.crystaldecisions.report.web.event.av.a(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source)<br /> at

com.crystaldecisions.report.web.ServerControl.a(Unknown Source)<br /><br />2006-09-13 10:54:17<br />com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: JDBC Error: Unexpected null value found for member RptObj.getValue.---- Error code:-2147467259 Error code name:failed<br /> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)<br /> at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)<br /> at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.ac.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b2.a(Unknown Source)<br /> at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)<br /> at com.crystaldecisions.report.web.event.av.a(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)<br /> at com.crystaldecisions.report.web.WorkflowController.doLifecycle(Unknown Source)<br /> at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)<br /> at java.lang.Thread.run(Thread.java:595)<br />Caused by: com.crystaldecisions.reports.formatter.formatter.c: JDBC Error: Unexpected null value found for member RptObj.getValue.<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)<br /> at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)</p><p>&nbsp;</p>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

This problem is pretty serious... anyone there??<br />

SJohnson
Employee
Employee
0 Kudos

Hi,

I have published the POJO Utility Class Sample to:

<a href="http://ftp1.businessobjects.com/outgoing/StrategicAlliance/eclipse/pojo_sample_factory.zip"><u>*http://ftp1.businessobjects.com/outgoing/StrategicAlliance/eclipse/pojo_sample_factory.zip*</u></a></p><p>This utility can be used to convert your POJOs to ResultSets prior to passing them to the report. For example, the code below demonstrates how to use the sample utility class in a Java class:</p><p> </p><hr width="100%"/> <p> </p><font color="black"><font size="1"><font face="Courier New">package com.businessobjects.samples.pojo;<br/><br/>import java.sql.Date;<br/><br/>import javax.swing.SwingUtilities;<br/><br/>import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;<br/>import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;<br/><br/>public class JRCPOJODatasource {<br/><br/>   private static final String REPORT_NAME = "Report1.rpt";<br/>   <br/>   public static void launchApplication() {<br/>      <br/>      try {<br/>                           <br/>         //Open report.<br/>         ReportClientDocument reportClientDoc = new ReportClientDocument();<br/>         reportClientDoc.setReportAppServer("inproc:jrc");<br/>         reportClientDoc.open(REPORT_NAME,1);<br/>         <br/>         //Build Report data set. The SimplePOJO class is included with this sample in SimplePOJO.java.<br/>         SimplePOJO [] data = {<br/>               new SimplePOJO("johnny", "doe", 13, new Date(62, 11, 02)),<br/>               new SimplePOJO("james", "brown", 42, new Date(99, 11, 31)),<br/>               new SimplePOJO("ray", "black", 39, new Date(99, 11, 31))<br/>         };<br/>         <br/>         //Use the POJO sample API for generating a Java Resultset from the SimplePOJO class.<br/>         POJOResultSetFactory factory = new POJOResultSetFactory(SimplePOJO.class);<br/>         POJOResultSet resultSet = factory.createResultSet(data);<br/>         <br/>         <br/>         reportClientDoc.getDatabaseController().setDataSource(resultSet);<br/>         reportClientDoc.save();<br/>         System.out.println("Done!");         <br/>   <br/>      }<br/>      catch(ReportSDKException ex) {   <br/>         System.out.println(ex);<br/>      }<br/>      catch(Exception ex) {<br/>         System.out.println(ex);         <br/>      }<br/>      <br/>   }<br/>   <br/>   public static void main(String [] args) {<br/>      SwingUtilities.invokeLater(new Runnable() { <br/>         public void run() {<br/>            launchApplication();            <br/>         }<br/>      });<br/>               <br/>   }<br/>         <br/>}</font></font></font><p class="MsoNormal"><font face="Courier New" size="1" color="black"><span style="font-size: 8pt; font-family: "Courier New"; color: black"></span></font></p> <hr width="100%"/><p>In your case you will want to do some modifications prior to running it. To change the default behavior of null values for use in Boolean or Numbers you will want to modify the POJOResultSet.java file. Specifically the numberValueOf() method and the typedValueOf(int columnIndex, Class type, boolean allowNull) method. For the numberValueOf() method you will want to set the line:

 

<font face="Courier New" size="2" color="#7f0055"><span style="font-size: 10pt; font-family: "Courier New"; color: #7f0055; font-weight: bold">final</span></font><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black"> </span></font><font face="Courier New" size="2" color="#7f0055"><span style="font-size: 10pt; font-family: "Courier New"; color: #7f0055; font-weight: bold">boolean</span></font><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black"> allowNull = </span></font><font face="Courier New" size="2" color="#7f0055"><span style="font-size: 10pt; font-family: "Courier New"; color: #7f0055; font-weight: bold">true</span></font><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black">;</span></font></p><p class="MsoNormal">This will allow the typedValueOf() method to handle the null values. You will need to update this method to assign the value you want for nulls (e.g. 0)</p><p class="MsoNormal">Give this a try and let me know how it goes </p> <p>Regards,<br/>Sean Johnson (CR4E Product Manager) </p>

Former Member
0 Kudos

<p>Thanks for the code. </p><p>I believe I get the general concept. However, I have a question on these two lines...</p><p><font color="black"><font size="1"><font face="Courier New"> reportClientDoc.getDatabaseController().setDataSource(resultSet);<br /> reportClientDoc.save();</font></font></font></p><p>&nbsp;</p><p>I didn&#39;t really understand what was the goal of the setDataSource() without specifying a table name and the save(). So I ran your code to check it out. It looks like the save() is actually replacing ALL table definitions in the existing report file and with a definition matching the structure of the resultset we passed in and saving those changes to the report file.</p><p> - Why save any changes to the file? It seems like I would just want to convert the pojos to a resultset and pass it in at runtime to fix this null-value problem.</p><p>- Why is there no argument to specify a specific table? </p><p>&nbsp;</p><p>Anyway, your also code had some other beneficial effects in that it gave me some ideas to work around some of the issues I&#39;ve been having in working with POJOs. I have a few questions on that I&#39;ll post in a new thread in the How-To forum.</p><p>&nbsp;</p><p>&nbsp;</p>

SJohnson
Employee
Employee
0 Kudos

<p>Sorry about the confusion. This was a simple case of re-using a code snippet that I had wrote as a work-around for another forum thread:</p><p><a href="/node/780"><u><strong>http://diamond.businessobjects.com/node/780</strong></u></a></p><p>In that scenario, the user needed to see the changes reflected in the design time experience as well, hence the save() call. As for the setDataSource() method, you will also find this method off of the Table object if you need to change only one instance. For the sake of simplicity my code assumed that there was only one POJO/Table in the report and used the top-level setDataSource method to populate the data.</p><p>I hope this helps answer some of the confusion. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) </p>

Former Member
0 Kudos

Ok, no problem. I thought maybe that was the case, but just wanted to make sure I wasn&#39;t missing something.

Former Member
0 Kudos

<p>Ok, I never really noticed this last statement until just now.</p><p>"This will allow the typedValueOf() method to handle the null values. You will need to update this method to assign the value you want for nulls (e.g. 0)"</p><p>Does this mean I still can&#39;t have null values in the report for numeric and boolean types? At first I thought this was a solution to the null value problem, but now it sounds like you&#39;re suggesting we just change it so that the report engine never receives nulls. If that&#39;s the case, then that doesn&#39;t fix anything for me. I will have numeric fields that will have no data, and they need to be represented as such.... 0 (zero) has an entirely different meaning and thus would be giving incorrect results.</p><p>Please tell me my assumption is wrong or let me know if you have other suggestions.</p><p>&nbsp;</p><p>Thanks </p>

Former Member
0 Kudos

<p>Come on guys. I really need to know... do you consider this a bug and are working feverishly on it? Or do you consider this acceptable and will leave it this way? I started the move from BIRT to Crystal because it seemed more stable and seemed to be taking Java integration seriously. I understand that it&#39;s a v1.0 product and some bugs are to be expected. I have no problem with that. The problem I have is my perceived notion that you guys don&#39;t really care about things such as supporting basic data types or the product crashing because of null values.</p><p> If this were my product and the very core of it rendered it nearly useless for some of its targeted audience, then I would be scrambling to fix it while at the same time reassuring the users that I&#39;m working diligently on it. I have no idea if you&#39;re doing the first one, but I do know you&#39;re not doing the last one. </p> I&#39;m really starting to question the wisdom in my decision to choose CR4E. Can someone help me out here? A report tool cannot be taken seriously if it can&#39;t handle nulls or if the &#39;resolution&#39; is to substitute it for a non-null value.

SJohnson
Employee
Employee
0 Kudos

Sorry for the late turnaround. I was out of the office on the road for 2 weeks. I have been playing a little with the POJO sample and I believe the issue is how we implement the java.sql.ResultSet interface. By default we expect the boolean and integer values to be primitive types which means that they cannot accept null values. This is also the default behaviour for the java.sql.ResultSet class. If you take a look at the following URL you will notice that the *getBoolean() method for the java.sql.ResultSet class will return a value of +false*+ if it encounters a null value:

[http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getBoolean(int) | http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getBoolean(int)]

Similarly, you will notice that the getInt() method will return a value equal to 0 if it encounters a null value.

<a href="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getInt(int)">*http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getInt(int)* </a>

That being said, I did do some testing creating a Resultset from a SQL table which contained null values for both Boolean(bit) and Integer(int) fields. This did work with Crystal Reports, but using the getInt() and getBoolean() methods and trying to write the Resultset out to the screen resulted in the null values being replaced with 0 and false accordingly.

The best resolution to get you over this hurdle is to add some helper methods to your class to convert the Integer and Boolean properties to Strings. For example, in my sample class I created the following two helper classes:

public String getConvertAgeToString(){
      String value;
      if(this.age != null)
         value= this.age.toString();
      else
         value="";
     Â
      return value;
   }

public String getConvertAvailableToString(){
      String value;
      if(this.available != null)
         value= this.available.toString();
      else
         value="";
     Â
      return value;
   }

I found that I had to make the original get(Age() and getAvailable() methods private so that our POJOHelper class would not attempt to make a ResultSet with them. This is only necessary if you want to use the unmodified helper class to generate the ResultSet. If you keep your modifications then you should be okay if you pass in 0 and false for the original get() methods. It doesn't matter as we won't be using them in the report anyway.

For the sake of Boolean and Integer values, you should be able to interpret empty string ("") as null values and treat them accordingly in your Crystal Reports formulas. Using formulas you should be able to create the desired output using this method.

If you run into trouble getting these values to work in your formulas then let me know how you are trying to use the values and I will do my best to provide you with the appropriate syntax.

We will look into this to see how difficult the fix is, but the suggested work-around should get you up and running. As you mentioned, this is a version 1 release and we have to prioritize the bugs that are coming in. I can assure you that our team is working very diligently on this product and addressing as many issues as we can for the current release, while still finding time to work on the next version of the product. I understand your frustration, but your last post questioning the original work-around came in just over 2 weeks ago. Unfortunately, I was busy on the Developer Roadshow and our International User Conference so I was not able to read your post until this week. Once again, I apologize for the delay in the response time, I have asked other members of our Crystal Reports for Eclipse team to assist with the forums so hopefully we won't see this type of delay again.

Regards,
Sean Johnson (CR4E Product Manager)

<a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a> </p>

Former Member
0 Kudos

Wow, late to the party.

I'm running into similar issues. As explained by the OP. When my POJO property is null i'm returned the following error:

Caused by: java.sql.SQLException: unexpected null value found for member

My jar files came from the POJOsample located on the CR4E v2 website. Was the jars updated to handle null properties?

Former Member
0 Kudos

SOLVED: I took into account Sean's suggestion and created a wrapper class.

class newClass () {

     private final Long id;

     private final String title;

     public newClass(OldClass oldClass) {

          this.id = oldClass.getId();

          this.title = oldClass.getTitle();

     }

  

     public getId() {

          return id == null ? 0l : id;
     }

     public getTitle() {

          return title == null ? "" : Title;

     }
}

My controller looks like:

reportClientDoc.getDatabaseController().setDataSource(newClass oldClass, newClass.class oldClass.class, "newClass" "oldClass", "newClass" "oldClass")