flamant Posted May 14, 2012 Share Posted May 14, 2012 Hi,I implemented a master report that contains 2 subReports<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="crf" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/><style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/> <style name="table"> <box> <pen lineWidth="1.0" lineColor="#000000"/> </box> </style> <style name="table_TH" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_CH" mode="Opaque" backcolor="#FFBFBF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_TD" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="border" isBlankWhenNull="false" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0"/> <leftPen lineWidth="1.0"/> <bottomPen lineWidth="1.0"/> <rightPen lineWidth="1.0"/> </box> </style> <parameter name="SIMPLE_DATA" class="java.util.HashMap"> </parameter> <parameter name="subReport_6071684_JasperReport" class="net.sf.jasperreports.engine.JasperReport"/> <parameter name="subReport_14892984_JasperReport" class="net.sf.jasperreports.engine.JasperReport"/> <field name="softwareVersion" class="java.lang.String"/> <field name="subNbr" class="java.lang.Integer"/> <field name="activityName" class="java.lang.String"/> <field name="sstStatus" class="java.lang.String"/> <field name="scheduleName" class="java.lang.String"/> <field name="subReport_6071684" class="java.lang.String"/> <field name="subReport_14892984" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="4" splitType="Stretch"/> </title> <pageHeader> <band height="45" splitType="Stretch"> <frame> <reportElement style="border" mode="Opaque" x="1" y="0" width="555" height="45" forecolor="#000000" backcolor="#FFFFFF"/> <staticText> <reportElement x="3" y="32" width="53" height="13"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[schedule:]]></text> </staticText> <textField > <reportElement x="56" y="32" width="139" height="13"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{scheduleName}]]></textFieldExpression> </textField> <staticText> <reportElement x="2" y="8" width="42" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[subject:]]></text> </staticText> <textField> <reportElement x="44" y="8" width="63" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{subNbr}]]></textFieldExpression> </textField> <textField bookmarkLevel="3"> <reportElement x="192" y="5" width="177" height="18"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{activityName}]]></textFieldExpression> <anchorNameExpression><![CDATA[ $F{activityName}]]></anchorNameExpression> </textField> <textField> <reportElement x="201" y="27" width="151" height="18"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[($F{sstStatus}.equals("131")? "Completed":$F{sstStatus}.equals("132")? "Completed with Information not available":$F{sstStatus}.equals("133")? "Completed with Forced Validation ":$F{sstStatus}.equals("141")? "Completed after unmarking ":$F{sstStatus}.equals("142")? " Information Not Available after unmarking ":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("151")? "Completed after unmarking ":$F{sstStatus}.equals("152")? " Information Not Available after unmarking ":$F{sstStatus}.equals("153")? "Forced Validation after marking":$F{sstStatus}.equals("999")? "Never entered":$F{sstStatus}.equals("111")? "Marked":$F{sstStatus}.equals("121")? "Marked":$F{sstStatus}.equals("134")? "Data pending":$F{sstStatus}.equals("141")? "Completed after unmarking":$F{sstStatus}.equals("151")? "Completed after unmarking":$F{sstStatus}.equals("142")? "Information Not Available after unmarking":$F{sstStatus}.equals("152")? "Information Not Available after unmarking":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("153")? "Forced Validation after marking": ($F{sstStatus}.equals("144") || $F{sstStatus}.equals("154"))? "Data pending after marking":$F{sstStatus}.equals("112")? "Marked with Information not available":$F{sstStatus}.equals("122")? "Marked with Information not available":$F{sstStatus}.equals("113")? "Marked with Forced Validation ":$F{sstStatus}.equals("123")? "Marked with Forced Validation ": $F{sstStatus}.equals("135")? "Medical doctor": $F{sstStatus}.equals("241")? "Unmarked and completed on cleaned data": $F{sstStatus})]]></textFieldExpression> </textField> <image> <reportElement x="408" y="0" width="146" height="45"/> <imageExpression><![CDATA["/Users/xflamant/Documents/enable/src/main/webapp/img/logo-gsk.gif"]]></imageExpression> </image> </frame> </band> </pageHeader> <columnHeader> <band height="4" splitType="Stretch"/> </columnHeader> <detail> <band height="594" splitType="Stretch"> <subreport> <reportElement positionType="FixRelativeToTop" x="0" y="0" width="554" height="297"/> <subreportParameter name="subReport_6071684"> <subreportParameterExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_6071684})]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_6071684})]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{subReport_6071684_JasperReport}]]></subreportExpression> </subreport> <subreport> <reportElement positionType="FixRelativeToTop" x="0" y="297" width="554" height="297"/> <subreportParameter name="subReport_14892984"> <subreportParameterExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_14892984})]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_14892984})]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{subReport_14892984_JasperReport}]]></subreportExpression> </subreport> </band> </detail> <columnFooter> <band height="8" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="30" splitType="Stretch"> <frame> <reportElement mode="Opaque" x="1" y="0" width="554" height="30" forecolor="#D0B48E" backcolor="#FFFFFF"/> <textField pattern="ddMMMyyyy HH:mm:ss"> <reportElement style="Column header" x="432" y="4" width="119" height="13" forecolor="#000000"/> <textElement verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="224" y="3" width="39" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+"/"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="264" y="3" width="40" height="20"/> <textElement/> <textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <staticText> <reportElement x="432" y="18" width="30" height="11"/> <textElement> <font fontName="Arial" size="8"/> </textElement> <text><![CDATA[eN@ble]]></text> </staticText> <textField evaluationTime="Report"> <reportElement x="464" y="19" width="86" height="10"/> <textElement> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$F{softwareVersion}]]></textFieldExpression> </textField> <textField> <reportElement x="1" y="0" width="116" height="14"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{activityName}]]></textFieldExpression> </textField> <textField> <reportElement x="1" y="14" width="116" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[($F{sstStatus}.equals("131")? "Completed":$F{sstStatus}.equals("132")? "Completed with Information not available":$F{sstStatus}.equals("133")? "Completed with Forced Validation ":$F{sstStatus}.equals("141")? "Completed after unmarking ":$F{sstStatus}.equals("142")? " Information Not Available after unmarking ":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("151")? "Completed after unmarking ":$F{sstStatus}.equals("152")? " Information Not Available after unmarking ":$F{sstStatus}.equals("153")? "Forced Validation after marking":$F{sstStatus}.equals("999")? "Never entered":$F{sstStatus}.equals("111")? "Marked":$F{sstStatus}.equals("121")? "Marked":$F{sstStatus}.equals("134")? "Data pending":$F{sstStatus}.equals("141")? "Completed after unmarking":$F{sstStatus}.equals("151")? "Completed after unmarking":$F{sstStatus}.equals("142")? "Information Not Available after unmarking":$F{sstStatus}.equals("152")? "Information Not Available after unmarking":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("153")? "Forced Validation after marking": ($F{sstStatus}.equals("144") || $F{sstStatus}.equals("154"))? "Data pending after marking":$F{sstStatus}.equals("112")? "Marked with Information not available":$F{sstStatus}.equals("122")? "Marked with Information not available":$F{sstStatus}.equals("113")? "Marked with Forced Validation ":$F{sstStatus}.equals("123")? "Marked with Forced Validation ": $F{sstStatus}.equals("135")? "Medical doctor": $F{sstStatus}.equals("241")? "Unmarked and completed on cleaned data": $F{sstStatus})]]></textFieldExpression> </textField> </frame> </band> </pageFooter> <summary> <band height="9" splitType="Stretch"/> </summary></jasperReport> Unfornutaly I have a blank page except for header and footer. The central panel is blankThe 2 subReports are normally pages with fields inside with values and labels I don't see how to debug it, and I am wondering: if I have 3 subReports, does the pagination will be correctly incremented on 3 pages and does the headers and footers of each page of subReport will be the master report header and footer or the subReports one ? I am wondering if it is not an issue of paginationThank you if you can give me an clue 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