electronic.signals2 Posted June 22, 2018 Share Posted June 22, 2018 Hi, I've got a report (Vertical design) with 3 subreports (same file jrxml subreport) that overlap each of them.I've used elementGroup , pagebreak and float position but I can'tSubreports span page and overlap resultsPlease any suggestion to avoid overlapping? Is it possible to upload jrxml and pdf files?I'm using jasperreport 5.5.1 version. Code REPORT: </band> </title> <detail> <band height="45"> <elementGroup/> <elementGroup> <subreport> <reportElement positionType="Float" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="0" y="1" width="499" height="43" isRemoveLineWhenBlank="true"/> <subreportParameter name="title"> <subreportParameterExpression><![CDATA[$P{title1}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{list1})]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["subreport.jasper"]]></subreportExpression> </subreport> </elementGroup> <elementGroup/> <break> <reportElement x="0" y="44" width="100" height="1" isRemoveLineWhenBlank="true"> <printWhenExpression><![CDATA[new Boolean($F{list1}.size()!=0)]]></printWhenExpression> </reportElement> </break> </band> <band height="45"> <subreport> <reportElement positionType="Float" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="0" y="1" width="499" height="43" isRemoveLineWhenBlank="true"/> <subreportParameter name="title"> <subreportParameterExpression><![CDATA[$P{title2}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{list2})]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["subreport.jasper"]]></subreportExpression> </subreport> <break> <reportElement x="0" y="44" width="100" height="1" isRemoveLineWhenBlank="true"> <printWhenExpression><![CDATA[new Boolean($F{list2}.size()!=0)]]></printWhenExpression> </reportElement> </break> </band> <band height="45"> <subreport> <reportElement positionType="Float" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="1" y="1" width="499" height="43" isRemoveLineWhenBlank="true"/> <subreportParameter name="title"> <subreportParameterExpression><![CDATA[$P{title3}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{list3})]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["subreport.jasper"]]></subreportExpression> </subreport> <break> <reportElement x="0" y="44" width="100" height="1" isRemoveLineWhenBlank="true"> <printWhenExpression><![CDATA[new Boolean($F{list3}.size()!=0)]]></printWhenExpression> </reportElement> </break> </band> </detail></jasperReport>[/code]CODE SUBREPORT: </columnHeader> <detail> <band height="14" splitType="Stretch"> <elementGroup> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="169" height="14" isPrintWhenDetailOverflows="true"/> <box leftPadding="3" rightPadding="3"> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement textAlignment="Justified" verticalAlignment="Top"> <font size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{col1}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="169" y="0" width="170" height="14" isPrintWhenDetailOverflows="true"/> <box leftPadding="3" rightPadding="3"> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement textAlignment="Justified" verticalAlignment="Top"> <font size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{col2}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false"> <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="339" y="0" width="172" height="14" isPrintWhenDetailOverflows="true"/> <box leftPadding="3" rightPadding="3"> <topPen lineWidth="0.5"/> <leftPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> <rightPen lineWidth="0.5"/> </box> <textElement textAlignment="Justified" verticalAlignment="Top"> <font size="7"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{col3}]]></textFieldExpression> </textField> </elementGroup> </band> </detail></jasperReport>[/code] 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