2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Mark Clarke - mxc4 Cannot get simple sub-report tes to work 2003-05-17 15:32 I am tesitng a simple sub-report. I have a main report and a subreport. Both reports only contain static text. The subreport compiles and displays fine as a stand-alone. As a subreport it shows nothing. Below is the xml code for both. Any help appreciated. =================== Parent ===================== <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="Untitled_report_1" 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"> <title> <band height="42"> </band> </title> <pageHeader> <band height="0"> </band> </pageHeader> <columnHeader> <band height="0"> </band> </columnHeader> <detail> <band height="303"> <subreport isUsingCache="true"> <reportElement mode="Opaque" x="34" y="62" width="441" height="224" forecolor="#000000" backcolor="#00FFFF" positionType="Float" isPrintRepeatedValues="false" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <subreportExpression class="java.lang.String"><![CDATA["TurnAround.jasper"]]></subreportExpression> </subreport> <staticText> <reportElement mode="Transparent" x="125" y="8" width="307" height="44" forecolor="#000000" backcolor="#FFFFFF" positionType="FixRelativeToTop" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" verticalAlignment="Top" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text>Test Text</text> </staticText> </band> </detail> <columnFooter> <band height="0"> </band> </columnFooter> <pageFooter> <band height="0"> </band> </pageFooter> <summary> <band height="0"> </band> </summary> </jasperReport> ================================= Child ===================================== <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="TurnAround" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="220" pageHeight="150" columnWidth="220" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="NoPages" scriptletClass="TurnAroundChart" isTitleNewPage="false" isSummaryNewPage="false"> <variable name="TurnAroundImage" class="java.awt.Image" resetType="Report" calculation="System"> </variable> <title> <band height="8"> </band> </title> <pageHeader> <band height="0"> </band> </pageHeader> <columnHeader> <band height="0"> </band> </columnHeader> <detail> <band height="100"> <staticText> <reportElement mode="Opaque" x="8" y="12" width="197" height="77" forecolor="#000000" backcolor="#FFFFFF" positionType="Float" isPrintRepeatedValues="true" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Left" verticalAlignment="Top" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text>TEST</text> </staticText> </band> </detail> <columnFooter> <band height="0"> </band> </columnFooter> <pageFooter> <band height="0"> </band> </pageFooter> <summary> <band height="0"> </band> </summary> </jasperReport> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now