Jump to content
JasperReports Library 7.0 is now available ×

Now able to use sub reports properly


Recommended Posts

By: Dhruv K Vohra - dhruv_k_vohra

Now able to use sub reports properly

2003-01-22 13:22

Hi,

 

I have a simple report "sub1" [similar to the chart sample - only the pie-image is smaller at left aligned]. I made a copy of the report as another sub report "sub2" [the pie-image is right aligened].

 

I am able to compile, fill and view the above two reports independently.

 

Next, I wrote a simple master report "multi" which just contained the above two reports as sub-reports.

Problem) The 2 sub-reports do appear !

Question) how do I make this simple thing work :(

 

Note) The 2 sub-reports just have an image. The XML below is for "sub1"

 

 

<?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="sub1"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="595"

pageHeight="842"

columnWidth="535"

columnSpacing="0"

leftMargin="30"

rightMargin="30"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

scriptletClass="ChartScriptlet"

isTitleNewPage="false"

isSummaryNewPage="false">

<variable name="ChartImage" class="java.awt.Image" resetType="Report" calculation="System">

</variable>

<title>

<band height="0">

</band>

</title>

<pageHeader>

<band height="0">

</band>

</pageHeader>

<columnHeader>

<band height="0">

</band>

</columnHeader>

<detail>

<band height="660">

<image scaleImage="RetainShape" isUsingCache="false" evaluationTime="Now" hyperlinkType="None"> <reportElement

mode="Opaque"

x="11"

y="16"

width="238"

height="581"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="None" fill="Solid" />

<imageExpression class="java.awt.Image">$V{ChartImage}</imageExpression>

</image>

<staticText>

<reportElement

mode="Transparent"

x="11"

y="609"

width="237"

height="38"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="" pdfFontName="Helvetica-BoldOblique" size="10" isBold="true" isItalic="true" isUnderline="true" isPdfEmbedded ="false" pdfEncoding ="Cp1250" isStrikeThrough="true" />

</textElement>

<text><![CDATA[sub Report 1. Go for it.]]></text>

</staticText>

</band>

</detail>

<columnFooter>

<band height="1">

</band>

</columnFooter>

<pageFooter>

<band height="0">

</band>

</pageFooter>

<summary>

<band height="0">

</band>

</summary>

</jasperReport>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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