Jump to content
We've recently updated our Privacy Statement, available here ×

xavixxxx

Members
  • Posts

    3
  • Joined

  • Last visited

xavixxxx's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Thanks for your answer Lucian. It works fine. But i have still a problem. The subReport with the data coming from anotherObjectVOList doesn't appear on the PDF and i don't know why. Does anyone see a problem in my jrxml (part of the file) or in my code ? If i compile the report in the code, must i compile the subreport in the method too ? or it could work if the report is compiled in the code and the subreport is inserting directly in the report (as what i have tried above ) I have tried to find good examples or documentation on this point but i haven' t found. If you have that, I am interested. Thanks in advance. Xavixxxx
  2. Hello, I don't understand the solution gave to solve the problem : Errors were encountered when compiling report expressions class file: 1. JRBeanCollectionDataSource cannot be resolved or is not a type value = (net.sf.jasperreports.engine.JRDataSource)(new JRBeanCollectionDataSource(((java.util.List)field_projDetails.getValue())));/*$JR_EXPR_ID=39$*/ <------------------------> 2. JRBeanCollectionDataSource cannot be resolved or is not a type value = (net.sf.jasperreports.engine.JRDataSource)(new JRBeanCollectionDataSource(((java.util.List)field_projDetails.getOldValue())));/*$JR_EXPR_ID=39$*/ <------------------------> 3. JRBeanCollectionDataSource cannot be resolved or is not a type value = (net.sf.jasperreports.engine.JRDataSource)(new JRBeanCollectionDataSource(((java.util.List)field_projDetails.getValue())));/*$JR_EXPR_ID=39$*/ <------------------------> I have the same problem on a subreport and I don't manage to solve it. Could you help me please ?
  3. Hello, I have problem with subReport and beans. I have the following java code to create the Main report. ( The object used are described in the source code ) JasperDesign jasperDesign = JRXmlLoader.load( filepath ); JasperReport jasperReport = JasperCompileManager.compileReport( jasperDesign ); List<ObjectVO> objectVOList = new ArrayList<ObjectVO>(); objectVOList .add( ObjectVO ); JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport , new JRBeanCollectionDataSource( objectVOList ) ); JasperExportManager.exportReportToPdfFile( jasperPrint , filepath ); I have added in the classpath a jar containing the two objects ObjectVo and AnotherObjectVO. In my mainReport, i have the code below to include the subReport in the detail band : <subreport> <reportElement x="27" y="11" width="502" height="54"/> <dataSourceExpression><![CDATA[new JRBeanCollectionDataSource($F{anotherObjectVOList})]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "subReport.jasper"]]> </subreportExpression> </subreport> And in my subReport i have the following code in the detail band : <textField> <reportElement x="348" y="5" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{description}]]></textFieldExpression> </textField> I doesn't work and i don't understand why ? I have the following error : 1. JRBeanCollectionDataSource cannot be resolved to a type value = (net.sf.jasperreports.engine.JRDataSource)(new JRBeanCollectionDataSource(((java.util.List)field_anotherObjectVOList.getValue()))); <------------------------> 2. JRBeanCollectionDataSource cannot be resolved to a type value = (net.sf.jasperreports.engine.JRDataSource)(new JRBeanCollectionDataSource(((java.util.List)field_anotherObjectVOList.getOldValue())) <------------------------> 3. JRBeanCollectionDataSource cannot be resolved to a type value = (net.sf.jasperreports.engine.JRDataSource)(new JRBeanCollectionDataSource(((java.util.List)field_anotherObjectVOList.getValue()))); <------------------------> I have already see this error in another post but i there was'nt the solution. Could you help me ?It's a little bit urgent. Thanks in advance Xavixxxx Code: Post Edited by at 11/09/2009 16:07
×
×
  • Create New...