Jump to content
Changes to the Jaspersoft community edition download ×

subreport problem in javabean set datasource


naniivs

Recommended Posts

Hi,

 

I have a master report. I am sending parameters to subreports. But while running my subreprts are not shown .

 

I am using java bean set datasource in the master report.

 

I am new to ireports .please help me regarding this .

 

Thank you,

Nani

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I have 2 simple reports. MasterReport.jrxml and subreport.jrxml

 

 

master report

 

<?xml version="1.0" encoding="UTF-8" ?>

<!-- Created with iReport - A designer for JasperReports -->

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="MainReport"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<property name="ireport.scriptlethandling" value="2" />

<property name="ireport.encoding" value="UTF-8" />

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

 

<parameter name="Title" isForPrompting="true" class="java.lang.String"/>

<parameter name="name" isForPrompting="true" class="java.lang.String"/>

<parameter name="place" isForPrompting="true" class="java.lang.String"/>

 

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="43" isSplitAllowed="true" >

<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="15"

y="8"

width="100"

height="18"

key="textField"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement>

<font/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{Title}]]></textFieldExpression>

</textField>

</band>

</title>

<pageHeader>

<band height="0" isSplitAllowed="true" >

</band>

</pageHeader>

<columnHeader>

<band height="0" isSplitAllowed="true" >

</band>

</columnHeader>

<detail>

<band height="0" isSplitAllowed="true" >

</band>

</detail>

<columnFooter>

<band height="0" isSplitAllowed="true" >

</band>

</columnFooter>

<pageFooter>

<band height="0" isSplitAllowed="true" >

</band>

</pageFooter>

<summary>

<band height="69" isSplitAllowed="true" >

<subreport isUsingCache="true">

<reportElement

x="132"

y="14"

width="233"

height="33"

key="subreport-1"/>

<subreportParameter name="name">

<subreportParameterExpression><![CDATA[$P{name}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="place">

<subreportParameterExpression><![CDATA[$P{place}]]></subreportParameterExpression>

</subreportParameter>

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

<subreportExpression class="java.lang.String"><![CDATA["subreport.jasper"]]></subreportExpression>

</subreport>

</band>

</summary>

</jasperReport>

 

 

subreport

 

<?xml version="1.0" encoding="UTF-8" ?>

<!-- Created with iReport - A designer for JasperReports -->

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="subreport"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="255"

pageHeight="842"

columnWidth="195"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<property name="ireport.scriptlethandling" value="2" />

<property name="ireport.encoding" value="UTF-8" />

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

 

<parameter name="name" isForPrompting="true" class="java.lang.String"/>

<parameter name="place" isForPrompting="true" class="java.lang.String"/>

 

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="50" isSplitAllowed="true" >

<staticText>

<reportElement

x="1"

y="0"

width="72"

height="21"

key="staticText-1"/>

<box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font pdfFontName="Helvetica-Bold" size="12" isBold="true"/>

</textElement>

<text><![CDATA[Name]]></text>

</staticText>

<staticText>

<reportElement

x="73"

y="0"

width="121"

height="21"

key="staticText-2"/>

<box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font pdfFontName="Helvetica-Bold" size="12" isBold="true"/>

</textElement>

<text><![CDATA[Place]]></text>

</staticText>

<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="1"

y="20"

width="72"

height="21"

key="textField-1"/>

<box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{name}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="73"

y="20"

width="121"

height="21"

key="textField-2"/>

<box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{place}]]></textFieldExpression>

</textField>

</band>

</title>

<pageHeader>

<band height="0" isSplitAllowed="true" >

</band>

</pageHeader>

<columnHeader>

<band height="0" isSplitAllowed="true" >

</band>

</columnHeader>

<detail>

<band height="0" isSplitAllowed="true" >

</band>

</detail>

<columnFooter>

<band height="0" isSplitAllowed="true" >

</band>

</columnFooter>

<pageFooter>

<band height="0" isSplitAllowed="true" >

</band>

</pageFooter>

<summary>

<band height="0" isSplitAllowed="true" >

</band>

</summary>

</jasperReport>

 

 

please help me why i am unable to see my sub report.

 

tnk u,

nani

 

[file name=MainReport.jrxml size=3092]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/MainReport.jrxml[/file]

Link to comment
Share on other sites

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...