dirko Posted January 9, 2008 Share Posted January 9, 2008 Hello, I am observing some weird behaviour with the layout in my subreport. To investigate the problem I stripped down my master report (only including a subreport) and subreport (only containing columHeader with backcolor). When creating a pdf of the subreport itself it looks ok (a header with a grey background), but when creating a pdf from the master report, the first column in the subreport has a white background and the height of the grey area has increased (see attached image). Any clue what is going on here? masterReportCode:<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="InvoiceMaster" pageWidth="595" pageHeight="842"><!-- A4 --> <style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <parameter name="overviewSubreport" class="net.sf.jasperreports.engine.JasperReport"></parameter> <parameter name="overviewDataSource" class="net.sf.jasperreports.engine.JRDataSource"></parameter> <parameter name="overviewParameterMap" class="java.util.Map"></parameter> <detail> <band height="200"> <subreport isUsingCache="false"> <reportElement x="0" y="5" width="555" height="100"/> <parametersMapExpression>$P{overviewParameterMap}</parametersMapExpression> <dataSourceExpression>$P{overviewDataSource}</dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport">$P{overviewSubreport}</subreportExpression> </subreport> </band> </detail></jasperReport> subReportCode:[code]<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="InvoiceOverviewSubreport" pageWidth="555" pageHeight="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <parameter name="tArticle" class="java.lang.String"></parameter> <parameter name="tNbrOfUnits" class="java.lang.String"></parameter> <parameter name="tUnitPrice" class="java.lang.String"></parameter> <parameter name="tExclVat" class="java.lang.String"></parameter> <parameter name="tAmountVat" class="java.lang.String"></parameter> <parameter name="tInclVat" class="java.lang.String"></parameter> <parameter name="tTotals" class="java.lang.String"></parameter> <parameter name="tVatRate" class="java.lang.String"></parameter> <field name="clientInteractionNumber" class="java.lang.String"></field> <field name="clientInteractionLegend" class="java.lang.String"></field> <field name="article" class="java.lang.String"></field> <field name="nbrOfUnits" class="java.lang.String"></field> <field name="unitPrice" class="java.lang.String"></field> <field name="exclVat" class="java.lang.String"></field> <field name="amountVat" class="java.lang.String"></field> <field name="inclVat" class="java.lang.String"></field> <columnHeader> <band height="30"> <textField> <reportElement mode="Opaque" x="0" y="5" width="155" height="15" backcolor="#ededed"/> <textElement textAlignment="Right" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{tArticle}]]></textFieldExpression> </textField> <textField> <reportElement mode="Opaque" x="155" y="5" width="80" height="15" backcolor="#ededed"/> <textElement textAlignment="Right" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{tNbrOfUnits}]]></textFieldExpression> </textField> <textField> <reportElement mode="Opaque" x="235" y="5" width="80" height="15" backcolor="#ededed"/> <textElement textAlignment="Right" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{tUnitPrice}]]></textFieldExpression> </textField> <textField> <reportElement mode="Opaque" x="315" y="5" width="80" height="15" backcolor="#ededed"/> <textElement textAlignment="Right" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{tExclVat}]]></textFieldExpression> </textField> <textField> <reportElement mode="Opaque" x="395" y="5" width="80" height="15" backcolor="#ededed"/> <textElement textAlignment="Right" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{tAmountVat}]]></textFieldExpression> </textField> <textField> <reportElement mode="Opaque" x="475" y="5" width="80" height="15" backcolor="#ededed"/> <textElement textAlignment="Right" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{tInclVat}]]></textFieldExpression> </textField> </band> </columnHeader> </jasperReport> Link to comment Share on other sites More sharing options...
dirko Posted January 9, 2008 Author Share Posted January 9, 2008 size of the image was too large in first post, so i'll try it again with a smaller size. size=400]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/Screenshot.png Link to comment Share on other sites More sharing options...
lucianc Posted January 9, 2008 Share Posted January 9, 2008 If you are using JasperReports 2.0.3, then this might happen because of the bug discussed here. Regards,Lucian Link to comment Share on other sites More sharing options...
dirko Posted January 9, 2008 Author Share Posted January 9, 2008 I switched back to 2.0.2 and now it works. Thanks for your quick response! 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