blutch Posted September 11, 2012 Share Posted September 11, 2012 Hi,I've created a subreport with quite simple details and sums that displays fine when I run it alone (page footer at the bottom of the subreport).When I run it inside the master report, the page footer of the subreport sticks to the detail. Its behavior isn't the same.How to place subreport footer at the bottom of subreport inside the master report ?i use iReport/JasperServer 4.5.1.Greetings, Stéphane. Link to comment Share on other sites More sharing options...
C-Box Posted September 11, 2012 Share Posted September 11, 2012 Hi,actually the masterreport itself is responsible for PageHeader/-Footer.But if you are just interested in pagefooter in this case, you could remove the pagefooter band in masterreport and set the SubReportProperty "RunToBottom" to true.... so your SubReport should fill the remaining space at master-level and renders it's own pagefooter at the end of the (master) page. hthC-Box Link to comment Share on other sites More sharing options...
blutch Posted September 11, 2012 Author Share Posted September 11, 2012 "run to bottom" sticks subreport's footer to the bottom of the master report. That's not what I want: I want that my subreport's footer stick to bottom of my subreport (with some space between my subreport's details and subreport's footer) inside the master report. I have content displayed after the subreport in my master report. Code: Code:<?xml version="1.0" encoding="UTF-8"?><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="casu" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.jasperserver.reportUnit" value="/Rapports/cg22/prcv/afi/casu/casu"/> <property name="ireport.jasperserver.url" value="http://V012003:9087/jaspertest/services/repository"/> <style name="table"> <box> <pen lineWidth="1.0" lineColor="#000000"/> </box> </style> <style name="table_TH" mode="Opaque" backcolor="#D5CBBF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_CH" mode="Opaque" backcolor="#FFF4E6"> <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> <parameter name="P_IN_courrier_index_dossier" class="java.lang.String"> <defaultValueExpression><![CDATA[]]></defaultValueExpression> </parameter> <parameter name="P_IN_courrier_aide_financiere" class="java.lang.String"/> <parameter name="P_IN_courrier_prestataire_aide" class="java.lang.String"/> <parameter name="P_CH_courrier_index_evenement" class="java.lang.String"/> <queryString> <![CDATA[sELECT "DO".CLASSOTHEQUE AS DO_CLASSOTHEQUE ,AF.CODE_AIDE_FINANCIERE AS AF_CODE_AIDE_FINANCIEREFROM CIVI.AIDE_FINANCIERE AF INNER JOIN CIVI.DOSSIER "DO" ON "DO".INDEX_DOSSIER = AF.INDEX_DOSSIERWHERE AF.INDEX_DOSSIER = $P{P_IN_courrier_index_dossier} AND AF.CODE_PRESTATAIRE_AIDE_FI = $P{P_IN_courrier_prestataire_aide} AND AF.CODE_AIDE_FINANCIERE = $P{P_IN_courrier_aide_financiere} AND AF.TYPE_DEMANDE_AIDE = $P{P_CH_courrier_index_evenement}]]> </queryString> <field name="DO_CLASSOTHEQUE" class="java.lang.String"/> <field name="AF_CODE_AIDE_FINANCIERE" class="java.math.BigDecimal"/> <pageHeader> <band height="12" splitType="Stretch"> <textField> <reportElement x="430" y="0" width="125" height="12"/> <box> <pen lineWidth="0.0"/> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Right"> <font fontName="DejaVu Sans Mono"/> </textElement> <textFieldExpression><![CDATA["N°" + $F{DO_CLASSOTHEQUE}+ " / " + $F{AF_CODE_AIDE_FINANCIERE}+ " / " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <staticText> <reportElement x="190" y="0" width="175" height="12"/> <box> <pen lineWidth="0.0"/> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement> <font fontName="DejaVu Sans Mono"/> </textElement> <text><![CDATA[Département des Côtes d'Armor]]></text> </staticText> <textField pattern="dd MMMMM yyyy"> <reportElement x="0" y="0" width="190" height="12"/> <box> <pen lineWidth="0.0"/> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement> <font fontName="DejaVu Sans Mono"/> </textElement> <textFieldExpression><![CDATA[fr.cg22.dsiru.esas.rsa.jasper.Outil.fmtDate( fr.cg22.dsiru.esas.rsa.jasper.Outil.getJour() ,"dd MMMM yyyy" )]]></textFieldExpression> </textField> </band> </pageHeader> <detail> <band height="778" splitType="Stretch"> <staticText> <reportElement x="0" y="10" width="555" height="14" forecolor="#666666"/> <box> <pen lineWidth="2.0" lineStyle="Double"/> <topPen lineWidth="0.0" lineStyle="Solid"/> <leftPen lineWidth="0.0" lineStyle="Double"/> <bottomPen lineWidth="2.0" lineStyle="Double"/> <rightPen lineWidth="0.0" lineStyle="Double"/> </box> <textElement> <font fontName="DejaVu Sans Mono" size="12" isBold="false"/> </textElement> <text><![CDATA[sITUATION FINANCIÈRE]]></text> </staticText> <subreport runToBottom="false"> <reportElement x="0" y="31" width="555" height="204"/> <subreportParameter name="P_IN_courrier_index_dossier"> <subreportParameterExpression><![CDATA[$P{P_IN_courrier_index_dossier}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["repo:/Rapports/cg22/prcv/afi/casu/sr/sf_files/sf_jrxml"]]></subreportExpression> </subreport> </band> </detail> <pageFooter> <band height="12" splitType="Stretch"> <textField> <reportElement x="215" y="0" width="125" height="12"/> <box> <pen lineWidth="0.0"/> <topPen lineWidth="0.0"/> <leftPen lineWidth="0.0"/> <bottomPen lineWidth="0.0"/> <rightPen lineWidth="0.0"/> </box> <textElement textAlignment="Center"> <font fontName="DejaVu Sans Mono"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+ " / " + $V{PAGE_COUNT}]]></textFieldExpression> </textField> </band> </pageFooter></jasperReport>Post Edited by skerain at 09/11/2012 14:51 Link to comment Share on other sites More sharing options...
C-Box Posted September 11, 2012 Share Posted September 11, 2012 Don't understand what you actually want to achieve... as in your sample code I see a background of 204pixel and a custom page size of 204pixel height... so your SubReport is always 204Pixel in height ... if there are more than 15 records (204 - 12 - 12 = 180/12 = 15) in SubReport a second (subReport)page will be rendered..... where should be some space between now?After each record in Master? After each detailBlock (=15 records) in SubReport? C-Box Link to comment Share on other sites More sharing options...
blutch Posted September 12, 2012 Author Share Posted September 12, 2012 I hope I will be more explicit with this 2 images. :) 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