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

Subreport not working with JavaBeans Collection datasource.


chavda.charmi

Recommended Posts

Hello,

I am able to make subreport with jdbc as datasource. But when I am taking JavaBeans Collection as datasource it is displaying simple report but subreport is not working.

I made two reports with JavaBeans Collection as datasource and both working individually but when i take one report as subreport of other subreport is not displaying blankspace is displaying.

I had attached report 1 into report 2 and when try to run report 2 it will display data related to report 2 but report 1 data is not displaying.

Below I had attached two reports. Please help.

Report 1

--------------

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2  --><!-- 2017-03-28T19:03:09 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="11" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="39e9808e-9998-440a-b04b-4cba8ba98dd6"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="test1.xml"/> <queryString>  <![CDATA[]]> </queryString> <field name="name" class="java.lang.String">  <fieldDescription><![CDATA[name]]></fieldDescription> </field> <columnHeader>  <band height="61" splitType="Stretch">   <staticText>    <reportElement x="22" y="0" width="100" height="30" uuid="dced702c-8f5d-4685-bf91-04ec034f68e7"/>    <text><![CDATA[name]]></text>   </staticText>  </band> </columnHeader> <detail>  <band height="52" splitType="Stretch">   <textField>    <reportElement x="22" y="10" width="100" height="30" uuid="fa24ec32-c976-4da4-be51-92b5ccfe9be1"/>    <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>   </textField>  </band> </detail></jasperReport>[/code]

 

Report 2

--------------

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2  --><!-- 2017-03-28T18:57:22 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="22" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ef85936a-bd39-45c1-8046-0c125107c40a"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="test2.xml"/> <queryString>  <![CDATA[]]> </queryString> <field name="firstName" class="java.lang.String">  <fieldDescription><![CDATA[firstName]]></fieldDescription> </field> <columnHeader>  <band height="39" splitType="Stretch">   <staticText>    <reportElement x="25" y="0" width="100" height="30" uuid="9f9f6623-88bd-4c19-88d9-6333a75b3c02"/>    <text><![CDATA[firstName]]></text>   </staticText>  </band> </columnHeader> <detail>  <band height="229" splitType="Stretch">   <textField>    <reportElement x="25" y="11" width="100" height="30" uuid="b836cc13-1993-4441-9c86-87d7f27452d7"/>    <textFieldExpression><![CDATA[$F{firstName}]]></textFieldExpression>   </textField>   <subreport>    <reportElement x="297" y="29" width="200" height="200" uuid="0c3112b7-3878-4477-b2fc-0013904dd9f6"/>    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>    <subreportExpression><![CDATA["11.jasper"]]></subreportExpression>   </subreport>  </band> </detail></jasperReport>[/code]
Thanks in advannce.
 
 
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...