Jump to content
Changes to the Jaspersoft community edition download ×

Subreport - REPORT_DATASOURCE


Recommended Posts

By: Ryan - louier79

Subreport - REPORT_DATASOURCE

2003-08-19 16:38

Hello,

 

My master report has the queryString and I would like to pass the results to the subreport. I tried using the REPORT_DATASOURCE, but I get the error message below.

 

Can anyone please tell me how to pass the results to a subreport? Code examples would be great.

Thank you for your assistance!!!

 

Error message:

dori.jasper.engine.JRException: Report design not valid :

1. Parameter not found : REPORT_DATASOURCE

 

at dori.jasper.engine.design.JRAbstractJavaCompiler.compileReport(JRAbstractJavaCompiler.java:110)

 

at dori.jasper.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:136)

 

at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135)

 

at dori.jasper.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:123)

 

at IReportCompiler.main(IReportCompiler.java:119)

 

master.xml except:

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

<parameter name="Bill_Header" isForPrompting="true" class="dori.jasper.engine.JasperReport"/>

...

<queryString><![CDATA[sELECT ...

...

<detail>

<band height="792">

<subreport isUsingCache="true">

<reportElement

mode="Transparent"

x="0"

y="0"

width="612"

height="260"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="false"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<dataSourceExpression>$P{REPORT_DATASOURCE}</dataSourceExpression>

<subreportExpression class="dori.jasper.engine.JasperReport">$P{Bill_Header}</subreportExpression>

</subreport>

 

 

 

 

 

 

By: Teodor Danciu - teodord

RE: Subreport - REPORT_DATASOURCE

2003-08-19 23:55

 

Hi,

 

It is REPORT_DATE_SOURCE.

There was a spelling mistake in the docs. Sorry!

 

I hope this helps.

Teodor

 

 

 

 

 

By: Ryan - louier79

RE: Subreport - REPORT_DATASOURCE

2003-08-20 08:05

Teodor,

 

Thank you for your assistance.

 

After changing REPORT_DATASOURCE to REPORT_DATA_SOURCE in the master report, the pdf returns blank pages, even though the subreport fills all the fields when run separately. Just to clarify the process, the master report performs the queryString and I want it to pass the ResultSet to the subreport.

 

Any suggestions?

 

Thank you again for your assistance!!!

 

Here is the code for the master report:

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

<jasperReport

name="Bill_Master"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="612"

pageHeight="792"

columnWidth="612"

columnSpacing="0"

leftMargin="0"

rightMargin="0"

topMargin="0"

bottomMargin="0"

whenNoDataType="AllSectionsNoDetail"

isTitleNewPage="false"

isSummaryNewPage="false">

<parameter name="Bill_Header2" isForPrompting="true" class="dori.jasper.engine.JRDataSource"/>

<queryString><![CDATA[sELECT

i.CAMPUS_ID,

i.HEADER_MESSAGE1,

i.HEADER_MESSAGE2,

i.PAYMENT_ADDRESS,

s.SID,

s.ACTIVITY_THROUGH,

s.AMOUNT_DUE,

s.DATE_DUE,

s.AMOUNT_PAID,

s.STUDENT_NAME,

s.BILL_RECORD_NUMBER,

s.SID2,

s.BILLING_HOURS,

s.PAYMENT_OR_CREDIT_DUE,

s.PAYMENT_OR_CREDIT_AMOUNT,

t.TRANS_DATE,

t.TRANS_DESCRIPTION,

t.TRANS_CHARGES,

t.TRANS_CREDITS_PAYMENTS

FROM

BRS_WEBBILLS_CAMPUS_INFO i,

BRS_WEBBILLS_ACCOUNT_SUMMARY s,

BRS_WEBBILLS_TRANSACTIONS t

WHERE

s.SID = '522-31-6590'

AND i.CAMPUS_ID = 'DN'

AND s.ACTIVITY_THROUGH = to_date('03/14/03','MM/DD/YY')

AND s.SID = t.SID

AND s.ACTIVITY_THROUGH = t.ACTIVITY_THROUGH

AND s.ACTIVITY_THROUGH = i.ACTIVITY_THROUGH]]></queryString>

<background>

<band height="0">

</band>

</background>

<title>

<band height="0">

</band>

</title>

<pageHeader>

<band height="0">

</band>

</pageHeader>

<columnHeader>

<band height="0">

</band>

</columnHeader>

<detail>

<band height="792">

<subreport isUsingCache="true">

<reportElement

mode="Transparent"

x="0"

y="0"

width="612"

height="260"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="false"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<dataSourceExpression>$P{REPORT_DATA_SOURCE}</dataSourceExpression>

<subreportExpression class="dori.jasper.engine.JasperReport"><![CDATA[$P{Bill_Header2}]]></subreportExpression>

</subreport>

</band>

</detail>

<columnFooter>

<band height="0">

</band>

</columnFooter>

<pageFooter>

<band height="0">

</band>

</pageFooter>

<summary>

<band height="0">

</band>

</summary>

</jasperReport>

 

Here is the code for the subreport:

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

<jasperReport

name="Bill_Header2"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="612"

pageHeight="260"

columnWidth="612"

columnSpacing="0"

leftMargin="0"

rightMargin="0"

topMargin="0"

bottomMargin="0"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<field name="HEADER_MESSAGE1" class="java.lang.String"/>

<field name="HEADER_MESSAGE2" class="java.lang.String"/>

<field name="SID" class="java.lang.String"/>

<field name="ACTIVITY_THROUGH" class="java.util.Date"/>

<field name="AMOUNT_DUE" class="java.lang.String"/>

<field name="DATE_DUE" class="java.util.Date"/>

<field name="AMOUNT_PAID" class="java.lang.String"/>

<field name="STUDENT_NAME" class="java.lang.String"/>

<field name="PAYMENT_ADDRESS" class="java.lang.String"/>

<field name="BILL_RECORD_NUMBER" class="java.lang.String"/>

<background>

<band height="0">

</band>

</background>

<title>

<band height="0">

</band>

</title>

<pageHeader>

<band height="0">

</band>

</pageHeader>

<columnHeader>

<band height="260">

<staticText>

<reportElement

mode="Transparent"

x="45"

y="20"

width="130"

height="15"

forecolor="#808080"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="Times-Roman" size="14" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>University of Colorado</text>

</staticText>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="45"

y="35"

width="205"

height="65"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

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

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="335"

y="25"

width="230"

height="75"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

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

</textField>

<rectangle>

<reportElement

mode="Opaque"

x="0"

y="205"

width="612"

height="55"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

</rectangle>

<rectangle>

<reportElement

mode="Opaque"

x="45"

y="100"

width="522"

height="25"

forecolor="#000000"

backcolor="#DDDDDD"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" />

</rectangle>

<staticText>

<reportElement

mode="Transparent"

x="60"

y="103"

width="59"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Student ID</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="150"

y="103"

width="80"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Activity Through</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="285"

y="103"

width="55"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Amount Due</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="380"

y="103"

width="45"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Date Due</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="470"

y="103"

width="55"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>AMOUNT PAID</text>

</staticText>

<line direction="TopDown">

<reportElement

mode="Opaque"

x="440"

y="100"

width="0"

height="25"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" />

</line>

<staticText>

<reportElement

mode="Transparent"

x="340"

y="246"

width="240"

height="10"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="6" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="true" />

</textElement>

<text><![CDATA[DETACH HERE AND RETURN UPPER PORTION WITH PAYMENT]]></text>

</staticText>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="60"

y="112"

width="59"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA["xxx-xx-" + $F{SID}.substring(7,11)]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="150"

y="112"

width="80"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[new SimpleDateFormat("MM/dd/yy").format($F{ACTIVITY_THROUGH})]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="#,###.##" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="285"

y="112"

width="55"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{AMOUNT_DUE}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="380"

y="112"

width="45"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[new SimpleDateFormat("MM/dd/yy").format($F{DATE_DUE})]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="481"

y="112"

width="40"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{AMOUNT_PAID}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="45"

y="155"

width="145"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{STUDENT_NAME}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="340"

y="160"

width="140"

height="40"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{PAYMENT_ADDRESS}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="340"

y="213"

width="240"

height="17"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="true" />

</textElement>

<textFieldExpression class="java.lang.String">$F{BILL_RECORD_NUMBER}</textFieldExpression>

</textField>

<staticText>

<reportElement

mode="Transparent"

x="477"

y="112"

width="5"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>$</text>

</staticText>

</band>

</columnHeader>

<detail>

<band height="0">

</band>

</detail>

<columnFooter>

<band height="0">

</band>

</columnFooter>

<pageFooter>

<band height="0">

</band>

</pageFooter>

<summary>

<band height="0">

</band>

</summary>

</jasperReport>

 

 

 

 

By: Teodor Danciu - teodord

RE: Subreport - REPORT_DATASOURCE

2003-08-20 08:46

 

Hi,

 

Why is it that in your subreport template you have

placed all your elements in the column header and

not in the details section as I would expect?

 

I hope this helps.

Teodor

 

 

 

 

 

By: Ryan - louier79

RE: Subreport - REPORT_DATASOURCE

2003-08-20 09:08

Hi,

 

I moved all the elements from the columnHeader to the details section and it still prints blank pages.

 

Any other suggestions?

 

Thank you again for your assistance!!!

 

Subreport code:

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

<jasperReport

name="Bill_Header2"

columnCount="1"

printOrder="Vertical"

orientation="Portrait"

pageWidth="612"

pageHeight="260"

columnWidth="612"

columnSpacing="0"

leftMargin="0"

rightMargin="0"

topMargin="0"

bottomMargin="0"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<field name="HEADER_MESSAGE1" class="java.lang.String"/>

<field name="HEADER_MESSAGE2" class="java.lang.String"/>

<field name="SID" class="java.lang.String"/>

<field name="ACTIVITY_THROUGH" class="java.util.Date"/>

<field name="AMOUNT_DUE" class="java.lang.String"/>

<field name="DATE_DUE" class="java.util.Date"/>

<field name="AMOUNT_PAID" class="java.lang.String"/>

<field name="STUDENT_NAME" class="java.lang.String"/>

<field name="PAYMENT_ADDRESS" class="java.lang.String"/>

<field name="BILL_RECORD_NUMBER" class="java.lang.String"/>

<background>

<band height="0">

</band>

</background>

<title>

<band height="0">

</band>

</title>

<pageHeader>

<band height="0">

</band>

</pageHeader>

<columnHeader>

<band height="0">

</band>

</columnHeader>

<detail>

<band height="260">

<staticText>

<reportElement

mode="Transparent"

x="45"

y="20"

width="130"

height="15"

forecolor="#808080"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="Times-Roman" size="14" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>University of Colorado</text>

</staticText>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="45"

y="35"

width="205"

height="65"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

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

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="335"

y="25"

width="230"

height="75"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

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

</textField>

<rectangle>

<reportElement

mode="Opaque"

x="0"

y="205"

width="612"

height="55"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

</rectangle>

<rectangle>

<reportElement

mode="Opaque"

x="45"

y="100"

width="522"

height="25"

forecolor="#000000"

backcolor="#DDDDDD"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" />

</rectangle>

<staticText>

<reportElement

mode="Transparent"

x="60"

y="103"

width="59"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Student ID</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="150"

y="103"

width="80"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Activity Through</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="285"

y="103"

width="55"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Amount Due</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="380"

y="103"

width="45"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>Date Due</text>

</staticText>

<staticText>

<reportElement

mode="Transparent"

x="470"

y="103"

width="55"

height="10"

forecolor="#000000"

backcolor="#C0C0C0"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPEB.TTF" size="8" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>AMOUNT PAID</text>

</staticText>

<line direction="TopDown">

<reportElement

mode="Opaque"

x="440"

y="100"

width="0"

height="25"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<graphicElement stretchType="NoStretch" pen="1Point" fill="Solid" />

</line>

<staticText>

<reportElement

mode="Transparent"

x="340"

y="246"

width="240"

height="10"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="6" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="true" />

</textElement>

<text><![CDATA[DETACH HERE AND RETURN UPPER PORTION WITH PAYMENT]]></text>

</staticText>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="60"

y="112"

width="59"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA["xxx-xx-" + $F{SID}.substring(7,11)]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="150"

y="112"

width="80"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[new SimpleDateFormat("MM/dd/yy").format($F{ACTIVITY_THROUGH})]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="#,###.##" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="285"

y="112"

width="55"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{AMOUNT_DUE}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="380"

y="112"

width="45"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Center" verticalAlignment="Top" lineSpacing="Single">

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[new SimpleDateFormat("MM/dd/yy").format($F{DATE_DUE})]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="481"

y="112"

width="40"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{AMOUNT_PAID}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="45"

y="155"

width="145"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{STUDENT_NAME}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="340"

y="160"

width="140"

height="40"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{PAYMENT_ADDRESS}</textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" > <reportElement

mode="Transparent"

x="340"

y="213"

width="240"

height="17"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="Courier" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="true" />

</textElement>

<textFieldExpression class="java.lang.String">$F{BILL_RECORD_NUMBER}</textFieldExpression>

</textField>

<staticText>

<reportElement

mode="Transparent"

x="477"

y="112"

width="5"

height="12"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

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

<font fontName="sansserif" pdfFontName="LTYPE.TTF" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />

</textElement>

<text>$</text>

</staticText>

</band>

</detail>

<columnFooter>

<band height="0">

</band>

</columnFooter>

<pageFooter>

<band height="0">

</band>

</pageFooter>

<summary>

<band height="0">

</band>

</summary>

</jasperReport>

 

 

 

 

By: Teodor Danciu - teodord

RE: Subreport - REPORT_DATASOURCE

2003-10-05 02:19

 

Hi,

 

I'm not sure what happens, but one thing is for sure:

Passing the master report data source to the

subreport is not a good idea.

This is because REPORT_DATA_SOURCE is the data

source that the master report iterates on, and when

passed to the subreport, it will take over and

continue to iterate on the same data source from

where the master remained.

This is usually bad new both for the master report

and the subreport since the master will stop iterating

because its data source was "consumed" by the

subreport and the subreport will display records

probably beginning with the second one

since the first iteration was "consumed" in the master

report when calling the subreport in the first place.

This is probably what happens on you case if that particular data source has only one record in it.

That record is used by the master when starting to

iterate and the subreport has no more records to

iterate, so it displays nothing. So you get a blank

document.

 

Please reconsider your design.

 

I hope this helps.

Teodor

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